Reputation: 39181
In the case we are setting up the the viewcontroller from storyboard then creating a viewcontroller class and attaching it the class to storyboard view. It seems this method is pointless, am I correct? Or are there some cases where this maybe useful?
- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil
{
self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
if (self) {
// Custom initialization
}
return self;
}
Upvotes: 0
Views: 77
Reputation: 2490
Imagine you create widgets inside one major, let's say fullscreen controller and those widgets have their own view controller and there is no transitions between each other. I would always rather go with set of NIB files in one project group folder, than squeezing them in one storyboard.
Another thing is that you have people not using storyboards due to certain causes.
Upvotes: 1
Reputation: 400
It was the only way to go if you had an universal view controller with two xibs for iPad/iPhone before iOS 4.0 and ~ipad naming convention.
Upvotes: 0
Reputation: 6485
What if you're storyboard is going to have many view elements and you don't want to add them programmatically, nor do you want to clutter your storyboard but you'd still rather use IB? That's at least one scenario.
Basically it depends on how your app grows, and how you intend to refactor it. Perhaps at the moment you don't find a need to use it, but what about later? Using it, or having the option to use it, is just another tool in your toolbox.
-- Update @trojanfoe has a good point as well. Programmatically creating your VCs and getting their views from a NIB
Upvotes: 1