/YZPermissionManager

YZPermissionManager can help you to get access to the simple and easy to use

Primary LanguageObjective-CMIT LicenseMIT

YZPermissionManager

Platform: iOS 8+ Cocoapods compatible License: MIT

YZPermissionManager can help you to get access to the simple and easy to use.

Supported permissions: Notifications, Location (WhileInUse, Always), Camera, Photos, Microphone, Contacts, Reminders, Calendar.

Requirements

iOS 8.0+

Example

Check the current status of the authority:

[YZPermissionManager checkPermissionWithResource:self.permissionResource
                                   completionHandler:^(YZPermissionStatus status) {
                   // do some thing                    
                    }];

Request the system permission you need

[YZPermissionManager requestPermissionWithResource:self.permissionResource agreedHandler:^{
        // Continue to execute your code
    } rejectedHandler:^(YZPermissionStatus status) {
        [self showRejectAlertController];
    }];

When the user rejects your permission application, You can use the code, go to the system settings page

NSURL *systemSettingsURL = [NSURL URLWithString:UIApplicationOpenSettingsURLString];
        if([[UIApplication sharedApplication] canOpenURL:systemSettingsURL]) {
            [[UIApplication sharedApplication] openURL:systemSettingsURL];
        }

Installation

Just drag YZPermissionManager.h / YZPermissionManager.m to your iOS Project.

Contact

broccoliii

License

YZPermissionManager is available under the MIT license. See the LICENSE file for more info.