6

I'm an experienced C/C++ Windows developer writing my first real iOS application. Since I don't really have to worry about backward compatibility, I decided to jump in and use the new Storyboard functionality in XCode 4.3. What I'm finding is that, while storyboarding holds out the promise of laying out all the screens in your application including segues and gestures without writing any code, the reality is that anything but the most trivial of programs don't work when you run them, usually failing unceremoniously with a very unhelpful error message. Worse yet, you can't step through the code to see what is wrong, because there is no code.

So my question is this: Should a new iOS developer develop without Interface Builder and Nibs and Storyboards at first as suggested by this article?

UPDATE 2020-04-03: It looks like SwiftUI bridges this chasm nicely and will probably be the way to build iOS apps going forward. In SwiftUI you do have code to step through, and it gives you real time feedback in Xcode showing how your app will look when it is run. As of this writing, there is a great free 100 day course (no affiliation) that I've been enjoying which includes an intro to Swift. Recommended.

stephmur
  • 83
  • 9

2 Answers2

4

Yes! You should definitely use Storyboards to build your applications. One of the neat things about Interface Builder is that it doesn't abstract away the underlying concepts - you are still working with the same types of objects as you would in code (UIViewController, UIView, etc.).

This lets you still learn how UIKit works but experience the benefits of building your UI using a tool.

There is a WWDC presentation from last year that outlines the basics of using Storyboards in your apps:

https://developer.apple.com/videos/wwdc/2011/?id=309

retainCount
  • 4,478
  • 1
  • 22
  • 14
  • I want to believe this, but for one thing storyboards seem to act like a Beta product, very buggy. Example: I create a new storyboard Master View controller project. Change the popover table view to Static, enter in the static strings in 4 sections. Only the first section heading shows up, none of the other strings show when you run the program. As another poster commented, sometimes storyboards need [duct tape](http://stackoverflow.com/questions/7921579/iphone-storyboard-editing-a-table-view) to work. When it won't even run correctly, even duct tape doesn't help. – stephmur Jun 19 '12 at 12:31
  • @stephmur That's unfortunate. The table view controller in the template has a subclass that overrides the table view data source methods to populate it. When you switched the table view to static, the overrides were still in place. This caused the static table view's data source to be overruled. – retainCount Jun 19 '12 at 16:37
  • That's really cool that you figured that out. How can I learn how to use Storyboards without have your depth of knowledge from the start? Can you recommend any good sources or books? – stephmur Jun 21 '12 at 19:09
  • The View Controller Programming Guide is a good resource: http://tinyurl.com/7u8oryt, as are the WWDC 2011 & 2012 videos on Storyboards. – retainCount Jun 25 '12 at 16:50
2

This is quite subjective but I definitively agree. If you want to learn how iOS works definitively start the UI code first. Interface builder is useful to position elements quickly and accurately, but like the article mentions you'll be much more productive after you understand how the views and controllers work together.

Yavor Shahpasov
  • 1,453
  • 1
  • 12
  • 19
  • Sorry for changing my accepted answer. I wish I could accept them both because it appears that storyboards aren't as simple as they look so reality is I'll probably do both: improve my general knowledge and apply it to my use of Storyboards. – stephmur Jun 21 '12 at 19:26
  • I got a [book](http://www.amazon.com/iOS-Programming-Edition-Guides-ebook/dp/B007OWBAB0/ref=tmm_kin_title_0?ie=UTF8&m=AG56TWVU5XWC2&qid=1340313206&sr=1-1-catcorr) that claims to teach BOTH approaches, so I'll let you know if I fall in love. :) – stephmur Jun 21 '12 at 21:15