3 ms·
I'm confused by your comments. Interface Builder is pretty much a must-have for serious iOS developers. Of course, you may have your neckbeards that like codin
by runjake 16y ago
I'm confused by your comments.
Interface Builder is pretty much a must-have for serious iOS developers. Of course, you may have your neckbeards that like coding XIB files by hand in vim, but they are the exception.
I can see XCode being optional, though.
Edit: I didn't downvote you. I'm curious about your stance.
- milkshakes 16y agoInterface Builder is definitely not a must have. In many cases, it just gets in the way. You can easily override loadView and create your views by hand. In fact, for most of the good stuff, you have to do this.
- nomurrcy 16y agoI find that I used to do most of my work without nibs and do it in loadView. In recent releases I've been using xibs for a lot of the base layout and doing the rest in viewDidLoad. 99% of the time you can create most of your interface in IB and save yourself a bunch of time and make it more maintainable.
- wallflower 16y ago> In fact, for most of the good stuff, you have to do this. IB's biggest benefit is we can have our artists skin apps and check in the XIB - no programmer needed. This is very important once you start creating platform type apps. Skinning can be a very time consuming process; IB makes it more manageable. To clarify what milkshakes is saying, IB stops being useful when you are doing custom animations (e.g. moving subviews around - something that is very common if you have a custom animation). Usually, IB will beat a developer coding CGRect type code from scratch (unless they are using Opacity - a great tool that generates code and is very programmer friendly). A custom UIView will probably win the performance race but lose in the productivity/maintenance marathon. Once you start getting into custom rounded table cells, custom table headers that act as row 0 of the table cell, empty placeholder cells, CoreData, and table/cell animations - you are entering the dark side... Using IB for UITableViewCells doesn't have a significant performance penalty now because if you are doing custom cells - the client is probably willing to sacrifice 60fps scrolling - to get their custom table gradients/cell backgrounds (otherwise the cells would be opaque).
- Xuzz 16y agoI 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."
- runjake 16y agoThis 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.
- marksands07 16y agoIn all honesty, the only reason why I don't use IB is because I'm too lazy to learn how the advanced functionality and customization actually work. Besides that, I always end up wasting too much time trying to figure out why the app won't build because I forgot to ctrl+drag an outlet to the File Owner or something silly. I'm insanely faster at building the UI when I code by hand so I choose that over IB.