When I first started researching iPhone application coding and design, I was pretty surprised by the negativity people had towards Interface Builder. It seemed most of the tutorials and forum posts I found centered around programatically designing and laying out your interface, which struck me as odd considering Apple gives you a tool called Interface Builder!
Admittedly, Interface Builder (IB from here on out) won’t help you a lot if you’re making a purely OpenGL application. However, if you’re working with Cocoa Touch (like we were with Faced), then I would definitely suggest taking the time to get familiar with IB, because it will save you a lot of time in the long run, and it’s a great place to mock-up the UI of your application.
I think what discourages people from using IB is simply the connection mechanism between IB and your actual code. Placing buttons, images, lables, etc… on your View is pretty simple, but when it comes to actually hooking these items up to your code, it’s not very obvious at first. That’s not a problem though, right? If you’ve already learned the basics of Objective-C and Cocoa Touch, then learning IB is no harder. If you can layout your interface programmatically, then you can easily figure out IB.
Step 1: Read the guide. It’s amazing how many developers out there don’t want to read the docs! One thing that has impressed me is how well Apple documents its tools and API’s. There is a wealth of knowledge in the Developer Center, so take advantage of it!
Step 2: Practice a little. Create a test project and start messing around a bit with IB and your code. Once you get it, it’s like one of those great development “Ah-ha!” moments. Like the first time that Object Oriented programming actually clicked, or the first time some other programming paradigm just “made sense”, you will have that moment with IB. Once this happens, and you start using IB more and more, you will realize how much faster your interface development will become.
If you’re a one-developer show, and you’ve only ever laid out your interface through code, you probably won’t start now. That’s fine. It’s not wrong, it’s just less flexible. However, if you’re like us and the person/people who develop the UI/Graphics/Layout are non-programmers, then IB puts a lot of power in their hands, and frees up the code monkey’s like me to do the actual nuts-and-bolts work without having to deal too much with the interface. I’ll create the basic Class/Nib combo, and let Cam go nuts placing buttons, images, backgrounds… whatever. When he’s done, I hook all of his work up to the code in the back end with a few right-clicks and drags. It’s pretty nice once you get into a rhythm like that.
There will probably be another post here that actually goes more into the nuts-and-bolts of IB use, but right now I just wanted to say that IB is a good tool for Cocoa Touch development and certainly worth investigating.
Remember, the tools Apple have provided to you are for your benefit! Take some time to get familiar with them, and you will not be disappointed.
