0

I am using VIPER and at the moment I am a bit lost. How do I setup a UITabBarController in a UINavigationController and also add viewControllers to the UITabBarController? At the moment, all of my code gets messy and crashes all the time.

I'm looking for an example in Swift 3, can somebody point me in the right directions?

jbehrens94
  • 2,356
  • 6
  • 31
  • 59

1 Answers1

0

If you're lost with VIPER, I suggest you start with the sample project in SWIFT 3 from this post: https://www.ckl.io/blog/best-practices-viper-architecture.

Then, once you're familiar with the most common cases of VIPER modules, you can solve your problem:

1) Module A initializes and calls the CoreTabBarManager (Module B)

2) Each item on your tab bar will be a submodule of Module B. So Module B will initialize (but not call) its submodules.

3) When the user clicks the tab bar item, you just call the submodule (which have already been initialized by the CoreTabBarManager)

Marcelo Gracietti
  • 3,121
  • 1
  • 16
  • 24