iOS7: Just go all-in

Whether you’re upgrading an existing app or building a new app, my advice is to go all-in with iOS7. Like most things in life, it’s easier said than done, but the numbers support me on this point.

If you haven’t already heard, the iOS7 adoption rates have been astronomical. According to stats from mixpanel, in just over one week, almost two-thirds of iOS users have already upgraded to iOS7. SEVEN DAYS, and we’re already over 60%. So the $64k question is: Is it really worth my time, money, and effort to support iOS6? Probably not.

For the devs out there here are a couple of code snippets to get you moving.

That Pesky Status Bar

iOS7 brings with it, full layout (i.e. edge to edge) view controllers and translucent bars (nav bars, status bars, etc.). And because a view controller’s view now extends beneath the status bar, you’ll inevitably run into situations where the status bar blends into its background – making it appear invisible (don’t worry it’s still there).

Prior to iOS7 you could set the tint/style of the status bar with the following code:

[[UIApplication sharedApplication] setStatusBarStyle:UIStatusBarStyle animated:BOOL]

In iOS7 the statusBarStyle (among other things) is more or less handled at the view controller level. Thus depending on your view controller’s content/color you can dynamically set the status bar’s style so that there’s contrast. Here’s how you do it:

1. Implement the following method in your view controller

- (UIStatusBarStyle)preferredStatusBarStyle

2. And any time the method (above) returns a different value, make sure you call:

- (void)setNeedsStatusBarAppearanceUpdate

NOTE: If your view controller is part of a navigation controller’s stack, then you can change the tint of the nav bar and status bar simply by changing the UINavigationBar ‘barStyle’ and/or ‘barTintColor’ properties.

Hope that helps. Happy iOS7 Coding!