Hacker News new | past | comments | ask | show | jobs | submit login

I don't hand-code XIB files: I don't use XIB files. I do use Interface Builder for laying out a basic UI design, it's much better than sketching it by hand.

But when it comes to code, it's much easier to have everything in once place. Override -loadView on your UIViewController subclass, and create the views right there. Sure, grab the frame dimensions from IB, but when you create it in code you have full control of how it works. There's no magical linking of the right nib to the right view controller. There's no "outlets" that work most of the time -- except, and I've had issues with this, in a few methods where they don't. There's no almost-but-not-fully-correct parsing of your source code looking for the "IBOutlet" markers, and there's no custom UIView subclasses that you have to make in code anyway, because IB doesn't support configuring them.

Basically, similar to this line from the Zen of Python: "Explicit is better than implicit."




This is great info. I was pretty ignorant about this facet. Thanks for the response. Thanks to the other people responding to the OP's comment, too. This is what I love about HN.




Consider applying for YC's W25 batch! Applications are open till Nov 12.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: