Reputation: 3031
I want to re-organise our storyboards. We have about 25 small storyboards and about 5 big ones. The big ones are too large (it affects performance when working in xCode). The small ones sometimes contain only a scene or two. I wonder if there is a recommended story board size for best performance, so that I could use it as a guideline when deciding on how to manage the storyboards. Is there a documentation about it? Did anyone experiment with different storyboard sizes and measured performance impact?
Upvotes: 1
Views: 572
Reputation: 4301
I want to add some additional findings to the accepted answer.
We also have large project and we are using SwiftGen for creating ViewControllers and we don't use segues. So there should be no difference between single storyboard or many storyboards when you look at API fro creating ViewController:
MyViewController.instantiate()
I had an assumption that with a single storyboard, project might be building faster. And if this is true, we can write a script, which will merge all ViewControllers into one single storyboard, while developers continue work on smaller storyboards. But real world tests didn't met my expectations.
Our project has 89 ViewControllers in 61 storybaords.
So now I'm sold to one ViewController per storyboard approach. Because you have not only slightly better build times, but also you don't need to add identifiers to each ViewController in storyboard
Upvotes: 1
Reputation: 219
Using storyboards has it's benefits, and if you want to keep using storyboards there is no reason you should be worried about performance impact of having many storyboards even a storyboard for each ViewController
named after the ViewController
.
Keep in mind that big storyboards take ages to load in the Xcode preview because it renders the whole storyboard file; however, when loading a screen in the app, it would not be loading the whole file just parsing the correct view controller and render only that. Knowing that, you should not see any performance problems from a bigger storyboard in your app.
The general practice shows that it's not good for you as developer to use big storyboards due to merge conflicts, especially if multiple developers are working on the same storyboard file.
If your layout is simple enough it might be worth doing everything in code.
Upvotes: 3