PHPhotoLibrary.requestAuthorization { (systemStatus) in
switch systemStatus {
case .denied, .notDetermined, .restricted:
complete(.fail)
case .authorized:
complete(.success)
}
}
Hi @cleexiang ,
probably something like:
return Observable.create { (observer: AnyObserver<SystemStatusType>) in
PHPhotoLibrary.requestAuthorization { (systemStatus) in
observer.on(.next(systemStatus))
observer.on(.completed)
}
return Disposables.create()
}
@cleexiang there is also a really nice permissions library: https://github.com/sunshinejr/RxPermission that implements this for all the iOS permissions
Most helpful comment
@cleexiang there is also a really nice permissions library: https://github.com/sunshinejr/RxPermission that implements this for all the iOS permissions