In my app I have a Settings section which should be able to handle the app-privacy the same as the iOS settings does (using on/off switches).
I know how to gain authorization for photo library but is there a way to change the permission to .denied manually?
Here is my Authorizing code:
let status = PHPhotoLibrary.authorizationStatus()
if( status != .authorized ){
PHPhotoLibrary.requestAuthorization { status in
switch status {
case .authorized:
switchButton.setImage(UIImage(named: "SwitchOn"), for: .normal) // Change the button image for Switch On
break
case .denied, .restricted: break
//
case .notDetermined: break
//
}
}
}