RxSwift bindings for Permission API that helps you with Permissions in iOS.
RxPermission is available through CocoaPods. To install it, simply add the following line to your Podfile:
pod "RxPermission"
RxPermission makes a rx_permission
Observable that you can subscribe in order to receive signals.
Permission
.Contacts
.rx_permission
.subscribeNext { status in
print("Status: \(status)")
}
.addDisposableTo(disposeBag)
public enum PermissionType {
case Contacts
case LocationAlways
case LocationWhenInUse
case Notifications
case Microphone
case Camera
case Photos
case Reminders
case Events
case Bluetooth
case Motion
}
public enum PermissionStatus {
case Authorized
case Denied
case Disabled
case NotDetermined
}
For more info about permissions and statuses, please visit Permission's README.
To run the example project, clone the repo, and run pod install
from the Example directory first.
Sunshinejr, [email protected], @thesunshinejr
RxPermission is available under the MIT license. See the LICENSE file for more info.