Reputation: 17072
I'm working on 2 iOS apps using the "multiple nib files method".
I came across storyboards not long ago and this seems really great in terms of efficiency.
Any reason not to switch to storyboards (for quite simple applications) ? Are there any stuff that were possible in the old methods that are not more possible now ?
Upvotes: 1
Views: 488
Reputation: 100622
The main reason you might stick with NIBs and programmatic transitions rather than a storyboard is to retain compatibility with iOS 4 and below. Once you're supporting iOS 5 only there's going to be very little reason for using NIBs, however they'll still be useful for any occasion when you want to be able to load a resource on demand, possibly several times.
So, off the top of my head, I'd still expect to use NIBs to design UITableViewCells and other similar content, and as a way to store graphical-type data in a way that's visually editable.
I'm not sure how common a practice it is, but often when I want, say, for the palette used by a program to vary from target to target or by locale, I find it more manageable to create a NIB with a bunch of views set to the relevant palette colours and to programmatically load the NIB and pull the colours out. I find that to be a good solution because you set the visual properties of the thing through a visual editor, built right into the IDE.
Upvotes: 1
Reputation: 5054
The answer is... it depends. Storyboards are all fine and dandy, but there are circumstances where multiple nibs are still beneficial. For example, if you are using a scroll view to swap multiple subviews on and off screen then it's far easier to design each subview in its own NIB, then load and add them programatically.
I have found a comfortable compromise: I use a storyboard for the main app screen and any major state transitions (e.g. a 'main' mode to a 'config' mode), but I still use separate NIBs for subviews which are off-screen to start with (e.g. dynamically created popovers not tied to a fixed UI element.) I get the ease and efficiency of storyboards for big stuff which could be a bit tricky in the past, but I get full flexibility for designing very dynamic UIs using separate NIBs.
Anecdotally, I have heard that storyboards are a particular pain for people developing in teams of any significant size. They are extremely hard to share, and they make dividing up responsibilities for separate areas almost impossible. Separate NIBs work perfectly in those cases.
They're another tool, nothing more. They're certainly not a complete replacement (at least, not yet.)
Upvotes: 5
Reputation: 3803
I like storyboards over "multiple nib files method". Only difficult part i encounter in storyboards is Control object. Messaging between two views are little difficult but once you understand it will be very easy. All the stuff is possible which you can achieve by multiple nib files method. I will recommend you to use storyboards over multiple nib files.
Upvotes: 0