Getting permission to use the camera or photo library
As mentioned earlier, Apple stipulates that your app must inform the user if it wishes to access the camera or photo library. If you don’t do this, your app will be rejected and will not be allowed on the App Store. You’ll modify the Info.plist
file in your project to make your app display messages when it tries to access the camera or photo library. Follow these steps:
- Click the
Info.plist
file in the Project navigator to display a list of keys. Move your mouse pointer over any existing key and click the + button:
Figure 21.12: Editor area showing contents of Info.plist
- A field should appear, allowing you to enter an additional key:
- Enter the following keys:
NSPhotoLibraryUsageDescription NSCameraUsageDescription
- For each key’s value, enter a string that explains to...