Question

My project contains over 60 View Controllers and Xcode is very laggy when loading the storyboard.

How can I resolve this without switching to xibs? I am using Xcode 5.1 and iOS 7.x

Was it helpful?

Solution

Problem

Putting all of your ViewControllers in one Storyboard will significantly slow down Xcode (which renders XML to show your ViewControllers) if the number of the ViewControllers is above 10. Storyboard is not the place to put all of your views, because as its name suggests a board of a specific story.

Solution

Make multiple Storyboards with 5 or 6 ViewControllers each, where you can avoid rendering hell of multiple ViewControllers. You can divide your Application on different boards named by group functionality like LoginStoryboard, UserProfileStoryboard, etc.

You can instantiate a storyboard and present a specific controller by the code below:

UIStoryboard *storyBoard = [UIStoryboard storyboardWithName:@"Your Storyboard Name" bundle:nil];
UIViewController *viewController = [storyBoard instantiateViewControllerWithIdentifier:@"Your Controller ID"];
[self presentViewController:viewController animated:true completion:nil];

OTHER TIPS

Keep views in more than one storyboard. It's not the problem if not every controllers are connected with segues. There is no good way to keep a large number of views in a storyboard, in addition to working on a better computer.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top