How to add NSPhotoLibraryUsageDescription key in XCode for an iOS project

Introduction :

NSPhotoLibraryUsageDescription key was introduced in iOS 10. This key should be included in all iOS project if the app is accessing the userโ€™s photo library. In this post, I will show you how to add this key to an XCode project.

Steps to do that :

We need to add NSPhotoLibraryUsageDescription in the info.plist file. Follow the below steps for that :

Step 1 :

Click on the root file and click on the Info tab.

ios NSPhotoLibraryUsageDescription

Step 2 :

Expand the Custom iOS Target Properties tab.

NSPhotoLibraryUsageDescription

Step 3 :

Right-click on any key row and click on Add Row.

NSPhotoLibraryUsageDescription

Step 4 :

Add the key as NSPhotoLibraryUsageDescription with type String with value as the description. It will automatically change the key name to Privacy - Photo Library Usage Description. NSPhotoLibraryUsageDescription

The value of the key will be shown as a description of the popup shown to the user. So, write the value describing why your application needs access to the photo library.

Where is the color and why codevscolor ?

Long story short, I love paintings and I paint on weekends. We(me and my wife) have one Youtube channel. Below is a video that I did recently. If you love this please do subscribe to support us ๐Ÿ˜Š