Slavic the Slavic Slavic the Slavic - 2 years ago 42
iOS Question

How do I effectively use multiple Storyboards for 100+ view controllers?

So I have an app that will contain 100+ view controllers in Storyboard when it's done. I would like to create multiple storyboard for better organization and less lag while in development. I will have a main.storyboard that contains the 6 main categories (view controllers) and will branch off into the other view controllers (whether in the same or another storyboard).

I would rather not create a reference to each of my 100+ view controllers outside of the main.storyboard. I use the navigator to move around my view controllers as such:

let vcName = identities[indexPath.row]
let viewController = storyboard?.instantiateViewController(withIdentifier: vcName)
self.navigationController?.pushViewController(viewController!, animated: true)

Any help will be greatly appreciated. I'll provide any other information/clarification or additional code on request.

Thanks in advance.

Answer Source

Break up your view controllers by functional areas, creating a dedicated storyboard for each (or even more than one). You can then link them together using storyboard references if, for instance, you are worried you might lose the big picture view.

You can even do this storyboard refactoring afterwards by using the handy Extract Storyboard Xcode menu option (i.e., select a VCs subset and then click menu Editor > Extract Storyboard).

Of course, assuming you really need that many view controllers to begin with ;-)

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download