Giter Site home page Giter Site logo

tabbar-coordinator-example's Introduction

This is an example app Swift 5.0.x

TabBar with Coordinator

Example iOS app demonstrating how to use a UITabBar with the iOS Coordinator pattern.

There are many ways of implementing a Coordinator in your app. My preferred way of doing the Coordinator pattern at the moment is with this library which this project uses.

This project is meant to demonstrate 1 thing: how to show a UITabBar in your app where each screen of the tab hosts a child coordinator.

Here is an overview on how to do this:

  1. (link to source) Create a main coordinator the the AppDelegate starts and shows the first ViewController of the app. Since UITabBarController is a UIViewController, our TabBar will be our ViewController this coordinator starts.
  2. (link to source) Have your UITabBarController instantiate a child coordinator for each tab. The ViewControllers of our UITabBarController are the root ViewControllers of each of these coordinators.
  3. Done! The rest of the implementation of this app demonstrate the coordinator pattern more then how to use coordinators with a tab bar.

Getting started

  • Clone the repo to your machine.
  • pod install
  • Open workspace on your machine. Compile and run app.

Author

Levi Bostian image

Contribute

This project is open to pull requests to improve the project. To keep this project small, pull requests will only be merged if the changes fit into the vision of this project. Bug fixes, updating dependencies, documentation is always welcome.

Credits

Inspiration for this project comes from this doc that gave me the idea of referencing the ViewControllers within each child coordinator. Thanks!

tabbar-coordinator-example's People

Contributors

levibostian avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.