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 Build a Simple iPhone App (iOS7) Designing your App Customizing a Button

Objective C views in Xcode

Hello,

What is the benefit of adding Views, Buttons etc via programming (.h, .m) VS adding them in using the Main.storyboard? Just curious. More customization? Thanks, k

1 Answer

Keith,

There are advantages and disadvantages to both, using the storyboard you can see all the views that have been added, organize the layout and easily organize them in terms of hierarchy for rendering. Adding them in code will not make them visible in the storyboard, and requires you to manually organize them hierarchically. Creating in code is supposed to provide you more control over the views, and as I understand it most seasoned developers (I am not yet one) choose code. Also, in a large group project doing it in code is usually required as storyboards are generally not used since only one person can access the storyboard at a time. Understanding what is being done for you by the storyboard is important as you may need to do it manually at some point.

Thanks Dennis!!