News for hackers. Stuff that matters.
Re:Behind enemy lines: 3 months as an iOS developer at Google by objclxt on Thursday January 03, 2013 @08:52AM (#5002306)
XIBs and programatic layout is the Vim vs Emacs of the iOS world.

There are a lot of pros and cons of both. I used to spend a not insignificant amount of time trying to moderate debates between iOS engineers who favoured one approach versus the other.

Doing all your layout in code isn't inherently bad, and there are lot of Apple written apps that do this (conversely, some of the newer iOS built-in apps do use NIBs). The main problem that I've found with layout entirely in code is that whilst it's fine for you, the sole developer, once you bring in more people onto the project you can have problems with getting people up to speed on what exactly is going on where.

Of course, the solution to this is to enforce strict coding standards over how to layout the views themselves in code, which Google clearly do. And as the article points out, resolving merge conflicts in code is somewhat more enjoyable than in nibs.

That said, just as programatic layout isn't inherently bad, neither is leveraging interface builder strategically. Here's a good example: iPhoto on iPad has a completely custom interface that's mainly laid out programatically, but certain key elements are actually composited together in IB. For example, the brushes that slide up when touching up photos are being brought in from NIBs, but animated and manipulated in code. Using the nib file to load in the images reduces the code without sacrificing understanding (or at least, that's Apple's argument. There's a fantastic WWDC 2012 session that covers how the iPhoto UI is put together in more detail).

The TLDR; - the only risk of programatic layout that I see if developers going 'off piste' and laying out in a non standard way. With the right coding standards you should be fine.

Re:Behind enemy lines: 3 months as an iOS developer at Google by cageface on Thursday January 03, 2013 @09:04AM (#5002361)
XIBs and programatic layout is the Vim vs Emacs of the iOS world.

To me that implies that one essentially makes the other redundant but I prefer to see them as two powerful tools in my box that each have their uses. I've always thought the people that insist on doing everything in xibs were a little weird but going too far the other way doesn't make sense to me either.

Re:Behind enemy lines: 3 months as an iOS developer at Google by objclxt on Thursday January 03, 2013 @09:09AM (#5002381)
You're right, it's a pretty bad analogy! I was more going for the whole NIB/Code debate being something that's never going to be adequately resolved.
Re:Behind enemy lines: 3 months as an iOS developer at Google by morty16 on Thursday January 03, 2013 @11:17AM (#5002987)
> There's a fantastic WWDC 2012 session that covers how the iPhoto UI is put together in more detail).

Do you happen to know the session name or number?

Re:Behind enemy lines: 3 months as an iOS developer at Google by objclxt on Thursday January 03, 2013 @11:55AM (#5003231)
Sure, sorry - I should have put that in my original post. It's Session 243, iPhoto UI Progression and Design, with Randy Ubillos himself.
Re:Behind enemy lines: 3 months as an iOS developer at Google by julien_p on Thursday January 03, 2013 @11:54AM (#5003213)
Probably https://developer.apple.com/videos/wwdc/2012/?id=243 I haven't watched it yet, but it's been on my to-watch list for a while now.
Re:Behind enemy lines: 3 months as an iOS developer at Google by jsanz on Thursday January 03, 2013 @11:53AM (#5003210)
The session name is 'iPhoto for iOS: UI Progression and Animation Design'. It's under Essentials.
Re:Behind enemy lines: 3 months as an iOS developer at Google by Aqua_Geek on Thursday January 03, 2013 @11:14AM (#5002965)
Some of Apple's apps do their layout in code because the necessary features weren't available in Interface Builder yet (think of things like collection views, etc).