I've hit "cancel" on a popup that asks permission for the photo library in the app I made. This comes from something I didn't make, but from the OS.
Now I need a fallback if the user tries to hit the photo library button again. The authorization status is denied. I proved by checking it this way:
let status = PHPhotoLibrary.authorizationStatus()
switch status {
case .authorized:
print("authorized")
case .denied:
print("denied") // it is denied
case .notDetermined:
print("notDetermined")
case .restricted:
print("restricted")
}
How do I present a popup asking for permission to the photo library again? I've looked everywhere and cannot find anything that works.
I was hoping it was something like this, but PHPhotoLibrary has no member "requestAccess":
PHPhotoLibrary.requestAccess(for: ???) { response in
if response {
//access granted
} else {
}
}