Apax Software logo

Tips for getting your apps iOS 7 compliant

Tips for getting your apps iOS 7 compliant

Whether you like the new look of iOS 7 or not, it’s here to stay.  As a developer, you now face the task of getting your apps to follow suit and comply with the new SDK.  One of the biggest changes is the shift to a translucent navigation bar, and with it, the top of your views will be shifted up beneath it.  First off, don’t panic just yet…if your app was built with the iOS 6 SDK (or older), it will run in a “legacy mode” which will keep your content from sliding beneath the navigation bar…so all of your apps won’t just stop working when your users update to iOS 7.  The idea here is that your views can and should utilize the extra vertical space.  Scrolling views, for instance are able to stash something less important underneath the navigation bar that the user doesn’t need constant access to, but is able to access when they need to.  So without further ado, here are some tips and notifications to help get your apps ready for this major update.


Tip #1: How to keep your apps from hiding important content underneath the navigation bar (or tab bar)

This one is pretty simple – just add this one-liner to your view controller if you don’t want to use that space beneath the navigation bar or tab bar:

(See Tip #3 below for iOS 6 compatibility)


Tip #2: How to support both iOS 7, and previous versions simultaneously (Interface Builder)

If you’re using xib files, there are a few good options for you here depending on your implementation.  If you’re working on an older project that doesn’t use auto-layout, XCode has provided a way to make size and position variations between iOS 7 and previous versions:iOS deltas

The Measurements Inspector offers a iOS6/7 Deltas section which will resize a selected control based on whether it is running in iOS7 or not.  Note: this is only visible if you are not using auto-layout, which brings me to my next point:

If you’re not yet using auto-layout, now is the time to adopt it.  Auto-layout has been a little frustrating in the past…sometimes it can seem impossible to get a complicated view laid out correctly, then you move one little label, and auto-layout might move everything else as a result.  But it’s much easier to use now!  To toggle auto-layout on or off, there is a checkbox in the File Inspector:use autolayout

Last, in case you didn’t know about it, check out this little hidden menu to give you better control over auto-layout:

autolayout options


Tip #3: How to support both iOS 7, and previous versions simultaneously (Code)

You may find yourself wanting to use a new API that is only available in iOS 7, but still need to support users on iOS 6.  I find it is worth the time to create a set of macros to use to branch your code if absolutely necessary:

 Then to use them in your code:


Warning #1: Apps will no longer be accepted if they don’t have explicit support for retina devices and the 4-inch screen size

When the iPhone 5 came out with it’s taller screen size, apps that were not updated were simply displayed in a “letterbox” format, with black bars at the top and bottom to make up for the extra half-inch screen size.  This grace-period is now over, so don’t submit any app updates without first updating your app’s UI with high-resolution graphics and the larger screen size.

Twitter Feed

Testimonials

We had the need to manage a dozen simultaneous development projects in parallel. Apax was critical in bridging our gaps and working side by side with our developers.
Ben AskreniHigh