One of my earlier version of iOS app uses UIImagePickerController
. During that development period there's no permissions involved to access the photos/videos from album. But in latest version, it asks for permission of user to access album.
How can I check if the user has granted permission for accessing the photo album on the device with the help of UIImagePickerController
(not using ALAssetLibrary
)?
Update:
Since the PhotoKit framework was introduced in iOS 8 the best way to determine status is on PHPhotoLibrary
.
Objective-C:
[PHPhotoLibrary authorizationStatus];
Swift:
PHPhotoLibrary.authorizationStatus()
There isn't anything in the public interface for UIImagePickerController
that could be used to determine photo data authorization status. Alas, it seems the only option for determining authorization status is +[ALAssetsLibrary authorizationStatus]
.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With