Developing User Interfaces

It used to be that software was written strictly for desktop computers.  And although people had different monitors and video cards that provided some variety of resolutions, there weren’t that many different resolutions.  Moreover, there was even less variety in aspect ratios.

In the world of desktops, it hasn’t really changed that much.  The variety has increased slightly, but there’s still a limited number of aspect ratios.  But importantly, people are computing with phones.  And with each passing year, Apple, Samsung, and others announce a new set of phones with a new set of resolutions.  Even Apple has started adding quite a variety of resolutions and aspect ratios to what used to be a quite standard size.  Now more than ever it is exceptionally important that your user interface looks great on an exceptionally wide array of devices.

For iOS development, this means using Autolayout.  There are no excuses for avoiding Autolayout, and with the most recent WWDC, Apple has added yet another important reason to use Autolayout: iPad multitasking.  And we know how Apple is, right?  They want only the best for their end users.

A bit of history…

The iPhone 5s was released in September of 2013.  It was the first phone with a 64-bit processor.  A year later, Apple introduced the iPhone 6 and iPhone 6 Plus, both also had 64-bit processors.  There were also some 64-bit iPads released in this time period.  And then Apple announced that they would be rejecting app store submissions that did not include a 64-bit build.

Why?  Because the 64-bit build runs significantly better.  And if your app doesn’t provide a 64-bit build, then my 64-bit iPhone doesn’t really necessarily run your app that much better than someone else’s 32-bit iPhone runs your app.  If I’m an average iPhone consumer, I don’t know much about what goes into developing an iPhone application.  All I know is that the guy at the phone store told me that this phone runs faster than that phone.  And it’s true.  A 64-bit phone will run better than a 32-bit phone… but the most noticable differences will come when the 64-bit phone gets the arm64 builds which can run really fast.  So as a developer, your failure to provide a 64-bit build makes Apple’s 64-bit phones look not-so-great.

What’s any of this got to do with user interfaces?

Well, let’s take a look at the history of Autolayout.  Autolayout was introduced with Xcode 4.5, in September 2012.  This is around the same time that the iPhone 5 was released, and Autolayout made it easier to deal with two different iPhone heights.  With Xcode 6, Apple stopped creating iPhone/iPad specific storyboard files and instead went with a single universal storyboard file which basically relies on the developer properly using autolayout.  This also corresponded with the announcement of the iPhone 6 and iPhone 6 Plus.  Additionally, the Apple Watch was announced, adding yet annother screen size to the list of screen sizes we develop for.  Now, in the 2015 WWDC, Apple has announced iPad multitasking, and for your application to make use of that, one of the requirements will be using Autolayout.  Additionally, splash screens are no longer static images (which you create a million different sizes for), but instead an interface builder file which you need to use Autolayout to account for all of the different sizes.

Apple has been pushing Autolayout harder and harder with each passing year, giving developers more and more reasons to use it.  They’ve also shown a willingness to adopt a wider variety of screensizes now.

So, what’s all this mean for me as a developer?

If you haven’t started using Autolayout yet, start now.

If you aren’t a master of Autolayout yet, become one.

It’s hard at first, but it doesn’t take much effort before setting up your Autolayout constraints becomes second nature.  And in the end, it’s actually easier than any alternative to setting up layouts.  It’s certainly far less coding.  And it will definitely make your source code cleaner.  Heck, almost any time you’re moving some of your efforts into interface builder, you’re cleaning up your code.  And, it’s more efficient than manually setting your frames.

Ultimately, I wouldn’t even be surprised if very soon Apple stopped accepting app store submissions that don’t use Autolayout.

Leave a Reply