Tag Archives: iOS 10

What is the NSPhotoLibrary Usage Description key?

Since iOS 10 and Xcode 8, Apple have added (yet another) security check for our apps. This time it’s about our apps accessing the user’s photo library.

While it was a courtesy to ask the user for permission to use the library before, since iOS 10 we have to add a special key to the app target’s Info.plist file and give a reason why we want to have access.

Here’s how to do it:

Navigate to your project’s target and select the Info tab at the top. In the long list below, hover over any row and click on the little plus icon that comes up. This should add a new row to the table (or in other words, add an entry to the Info.plist file).

Now type in NSPhotoLibraryUsageDescription. It should automatically turn into “Privacy – Photo Library Usage Description”.

On the right hand side of your new row we can add a string value, which will become the description in the dialogue shown in the screenshot above. It seems that we’re free to add whatever we want here, explaining briefly that your app needs access to the user’s photos.

That’s it!

On this note, there are two other keys that may come in handy for accessing the user’s camera and microphone respectively:

  • NSCameraUsageDescriptionKey
  • NSMicrophoneUsageDescriptionKey

Just as with photos, add these keys and a brief description if your app needs access to either the camera or the microphone. Something like “for image sharing” should do nicely. Here’s what that message looks like in context when iOS presents the dialogue to the user:

The dialogue is shown only once, not every time when the user wants to share an image. Should the user decline, or should s/he want to change this, we should explain to them that this can be done under iOS Settings – Privacy – Photos.

Demo Project

I’ve updated my Demo Project on GitHub with the relevant changes so that it now runs correctly under iOS 10:

For an extensive list of other useful NSkeys, check out this Stack Overflow thread:





How to fix http load errors in your apps since iOS 10

In 2016, Apple have implemented a new rule that won’t let us load data from unsecured websites anymore. That’s those beginning with http:// instead of https:// (the latter ones are secured with an SSL certificate, and hence traffic is encrypted).

When you load an unsecured source, you’ll get an error message like this:

App Transport Security has blocked a cleartext HTTP (http://) resource load since it is insecure. Temporary exceptions can be configured via your app's Info.plist file.

If a secured source of the data is available, it’s probably the easiest method to change the feed. However, if that’s not an option, we can convince Xcode to let our apps download what’s known as data from “arbitrary” sources. Here’s how to do it.

First, in Xcode, navigate to your project’s target and find the Info tab. The target is the one that has your app icon showing, NOT the blue Xcode icon (top left, in the Project Navigator).

Now right-click on any of the many lines and select “Add Row”. This adds a value to your Info.plist file. Notice a list that comes up. Either select “App Transport Security” (if you can find it), or type NSAppTransportSecurity (it usually auto-completes). The entry will change into App Transport Security.

Let’s add the appropriate values to this new entry now. Hover over your new row now and select the little plus icon that comes up, then choose “Allow Arbitrary Loads” from the list. Alternatively, type in NSAllowsArbitraryLoads. Again this value will change to Allow Arbitrary Loads. Notice that this entry is a BOOL, and it needs to be set to YES on the right hand side. Go ahead and do that.

This will be enough to allow HTTP loads inside your app from any URL. You can restrict this to only certain URLs or hosts by adding another entry to the App Transport Security line, namely “Exception Domains”. Add each domain to its own line, and only data from those will be allowed to load via HTTP. If you want to use restricted domains, make sure to set the Allow Arbitrary Loads value to NO.





What’s new in iOS 10.2

iOS 10.2 introduces new features including the TV app (US Only), a new and unified experience for accessing your TV shows and movies across multiple video apps.

Emoji have been beautifully redesigned to reveal even more detail and over 100 new emoji have been added including new faces, food, animals, sports, and professions.

This update also includes stability improvements and bug fixes. Continue reading





What’s New in iOS 10

From the upgrade dialogue:

iOS 10 is the biggest release of iOS ever.

A massive update to Messages brings the power of the App Store to your conversations and makes messaging more personal than ever.

Find your route with beautifully redesigned Maps. Relive memories like never before in Photos. Use the power of Siri in more apps than ever. A new Home app to make controlling your home even easier. And all-new Music and News.iOS 10 introduces new features and improvements including:

Messages lets you express yourself in new ways and access your favorite apps right in your conversations

Siri now works with apps from the App Store to send messages, make phone calls, and more

Maps comes with an all new look and extensions to make reservations and book a ride

Photos is all-new with intelligent search making it easier to find people, places and more as well as new and beautiful ways to rediscover your memories

Home is a new app that lets you simply and securely manage your home automation products in one place

Apple Music has an all-new design, bringing greater clarity and simplicity to every aspect of the experience

Apple News has an all-new design adding bold typography, vibrant color, and distinct sections that make it easier to find stories on specific topics

Accessing the information you need is easier and quicker with a redesigned Lock Screen and deeper 3D Touch integration

QuickType keyboard adds new emoji, multi-lingual typing, and contextual predictions that leverage deep neural network technology

Suggested events and contact details are added to apps based on information found in Mail

Continue reading