iOS: You’re Doing Settings Wrong

One of the apparently less known features for iOS 8 and above is the ability to deep link the user into Settings, where they can enable their Location, Notifications, Contacts, Camera, Calendar, HealthKit, etc for your app as needed.

Most apps just have an alert that pops up giving instructions such as “Go to Settings > Privacy > Location > OUR_APP”. The Twitter app, for example, has a more elaborate, nicely styled directions dialog, so I’ll use it as an example here (but again, too many apps have a much worse version of this unfortunately):



So I’m writing this post as a frustrated user hoping that more iOS developers will just deep link directly to settings, especially since it’s so easy!

Ok, so here’s the code for an alert in a Calendar-related app I’m working on that will include an option to take the user into settings:

And just to point it out once again, this is the only code you need to add to deep link the user into the Settings for your app!

So when the user has denied the needed permission, you can now be a lot more like the Swarm app:

Swarm App Settings

When the user clicks “Open Settings”, they’re conveniently take to this screen:

Swarm Open Settings

Just adding these 3 lines of codes will improve the user experience for a very important aspect of your app – the need for permissions to be enabled!!! In my case, the user can’t even continue using the app without the Calendar being authorized. So making it the easiest possible for them to change the permissions in Settings is in my best interest. Same thing applies to many other apps out there.

Note: As @jl_hfl points out, this gets even better in iOS 9! The Settings screen will have a back button to take the user directly back into your app! Seriously, there is absolutely no excuse to NOT use this.

Enjoy the article? Join over 20,000+ Swift developers and enthusiasts who get my weekly updates.