Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Xcode: Is avoiding Interface Builder a good or bad idea? [closed]

I am slowly learning how to build Apps in Xcode and Objective-C and Ive been reading this blog post about writing Cocoa Touch Apps without ever using the Interface Builder, and this blog post about how someone just uses Interface Builder whenever they can.

I find myself leaning more towards avoiding to use the Interface Builder, as I can find problems faster if its just plain code, and at this point I am more familiar with writing code than using the Interface Builder.

So I am considering avoiding to use the Interface Builder altogether. But before I do I wanted to know the following:

  • Is there any time when you absolutely must use Interface Builder? Is there anything that is impossible to achieve without it? (I know the reverse is true.)

  • Are there any practices I can employ to help me not miss out on the advantages Tal Bereznitskey outlines for using Interface Builder. I am specifically thinking of the points he makes about it being easier to maintain and easier to prototype and change stuff.

  • Will ignoring the Interface Builder altogether put me at a disadvantage in anyway for building Apps in the future. Will the complex Apps that I hope to be working on in the future be significantly more difficult to develop if I just stick to writing code?

  • I am currently just building Apps by myself, but when I start working with other developers will I be at a significant disadvantage because I never learnt how to use Interface Builder, or will I be able to get by just knowing how to write code?

like image 894
Jimmery Avatar asked Jul 23 '13 16:07

Jimmery


1 Answers

My experience with development and the pros and cons of IB:

Start by letting IB remove complexity where it obscurs learning about core concepts expressible only in code. There is much to be said for the fact though that IB hides connections that would otherwise be obvious (and therefore easy to learn and debug), however generally it does a good job of removing extraneous code.

It's beneficial to learn as much as possible about the way view hierarchies and UI elements work without needing to use IB once you feel more comfortable with Objective-C and cocoa. I don't think there's anything you can't do in IB but theres certainly a lot that is more flexible and powerful when handled programatically.

From that point, once you understand the underlying functions then you can go back to using IB and let it save you time and energy you would otherwise use setting many many properties of UIKit elements.

To address your concerns about missing out. I'd say take some time to learn both Storyboards (a collective method of planning the UI) and XIB/NIB files (where a single file of UI is associated with a single view controller). Storyboards are newer and less perfectly understood by many people, including me! NIBs and XIBs are more powerful/less obvious but still very important as some things don't work so well in Storyboards.

In terms of working with others, IB can make version control a pain as the Plist/Backing of IB files doesn't always play nice with merging etc... However I'd say that if you're coming from a point of learning code first then moving to learn IB will be easier then the other way round. The most important rule of working in a team is to not be afraid to ask questions. Your code skills will help someone else who can in turn help you with IB.

Hope that helps. There's great tutorials on the Ray Wendlerlich site, google him.

like image 134
Cocoadelica Avatar answered Oct 07 '22 16:10

Cocoadelica