You can also request for access programmatically, which I prefer because in most cases you need to know if you took the access or not.
Swift 4 update:
//Camera
AVCaptureDevice.requestAccess(for: AVMediaType.video) { response in
if response {
//access granted
} else {
}
}
//Photos
let photos = PHPhotoLibrary.authorizationStatus()
if photos == .notDetermined {
PHPhotoLibrary.requestAuthorization({status in
if status == .authorized{
...
} else {}
})
}
You do not share code so I cannot be sure if this would be useful for you, but general speaking use it as a best practice.