iOS 10 error access private when using UIImagePickerController
Interview Questions practice on Codemia
Over 8,000 real interview questions from top companies, searchable by company and role.
Introduction
If your app logs an access error like [access] <private> when presenting UIImagePickerController, the root cause is usually privacy configuration, not the picker itself. Starting in iOS 10, Apple made camera and photo library access fail fast when usage description keys are missing. The fix is a combination of correct Info.plist entries and a permission flow that checks authorization before presentation.
Why This Error Appears on iOS 10
Before iOS 10, many apps could rely on weaker runtime checks and still work in testing. iOS 10 changed the contract. If your app touches camera or photo library APIs without a matching privacy usage string, the system denies access and may terminate the process.
UIImagePickerController can open either the camera or the photo library. Each source type has its own privacy requirement. In practice, that means your app must declare the reason for camera use and photo library use separately, even if your UI exposes one button.
The crash or access warning also appears when code paths are hidden behind conditional logic. A common case is opening the camera on one device and the photo library on another. If one key is missing, that path fails only on certain devices, so the issue appears random.
Required Info.plist Keys
At minimum, include the usage description keys that match all possible source types you present. Keep the message human and specific so users understand why you ask for access.
NSPhotoLibraryAddUsageDescription is only required when you save back into the library. If your app only reads images, the first two keys are typically enough. Still, teams often add all three to prevent future regressions when save functionality is introduced.
Safe Runtime Permission Flow in Swift
A stable approach is to check capability and authorization before presenting the picker. This keeps the flow deterministic and gives users a clear recovery path.
This pattern avoids presenting a picker that cannot read data. It also handles denied and restricted states instead of silently failing.
Common Pitfalls
The first pitfall is adding only one usage key. For example, teams add NSCameraUsageDescription and forget NSPhotoLibraryUsageDescription, then the library path fails in production.
The second pitfall is requesting authorization too late. If the picker is presented before permission is granted, users see broken behavior. Always request and validate first, then present.
Another frequent issue is unclear permission copy. If the string is vague, users deny access more often. Use concrete language tied to a visible user action, such as taking a receipt photo or selecting an avatar image.
Finally, developers sometimes test only on simulators where camera behavior differs from real devices. Run the full flow on physical hardware and test both granted and denied states.
Summary
- iOS 10 enforces privacy declarations for camera and library access.
UIImagePickerControllerneeds matchingInfo.plistusage keys for every source type you use.- Check authorization before presenting the picker to avoid runtime failures.
- Provide a clear Settings recovery path when access is denied.
- Test permission flows on real devices with multiple authorization states.
Related reading
- iOS 10 GM release error when submitting apps app attempts to access privacy-sensitive data without a usage description due to GoogleSignIn, AdMob
- iOS 11 - Keyboard Height is returning 0 in keyboard notification
- iOS 11 customise search bar in navigation bar
- iOS 11 disable password autofill accessory view option?
- iOS 7.0 No code signing identities found
- iOS 8 UITableView separator inset 0 not working
- iOS 11 navigation bar height customizing
- iOS 11 navigationItem.titleView Width Not Set
.png&w=3840&q=75)
Tackling System Design Interview Problems
A short course that equips you with the skills to approach system design interviews methodically.
Start the free courseTrack what you have practised
A free account saves your progress, solutions and study plan across every problem on Codemia.
Interview Questions practice on Codemia
Over 8,000 real interview questions from top companies, searchable by company and role.