Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

iOS

Storyboards vs. Code!

Treehouse team,

I typically use code to do all of my UI with iOS, but in the tutorial videos, each project uses storyboards. I'm wondering why this is.

In my opinion, it adds a level of abstraction that makes debugging and code readability harder.

So what's your take on this topic?

Thanks!

2 Answers

Ben Jakuben
STAFF
Ben Jakuben
Treehouse Teacher

There is a great Treehouse blog post and discussion in the comments about storyboards vs. creating things in code: http://blog.teamtreehouse.com/why-i-dont-use-interface-builder

In general I prefer storyboards for a few reasons, and one of the main reasons we use them in our Treehouse videos is because it's typically easier for newcomers to understand some of the concepts using storyboards than raw codes. I think a segue makes a lot more sense visually to a beginner than pushing/popping view controllers. But it's definitely a personal choice!

It's good to be familiar with both methods because you never know who you'll work with next or what projects you might join and what their existing approach might be.

Amit Bijlani
STAFF
Amit Bijlani
Treehouse Guest Teacher

There are lots of cases for and against it. Apple of course would prefer developers to use Storyboards because they have spent a lot of time and effort to make easy for us to build complex interfaces by simply dragging and dropping controls. Xcode has come a long way, the previous versions made it difficult for you to build an interface visually. However, with the Auto Layout improvements and Storyboards it's fairly easy to maintain a UI visually so why wouldn't you?