Latest 1.0.1
Homepage https://github.com/mlibai/XZAuthorizationManager
License MIT
Platforms ios 7.0, requires ARC
Frameworks UIKit
Authors

iOS App 权限管理

CocoaPods
License
Platform

演示

Demo

安装

CocoaPods

  1. 将 cocoapods 更新至最新版本。
  2. 在 Podfile 中添加 `pod ‘XZAuthorizationManager’ 。
  3. 执行 pod installpod update
  4. 导入 <XZAuthorizationManager/XZAuthorizationManager.h>

手动安装

  1. 下载 XZAuthorizationManager 文件夹内的所有内容。
  2. 将 XZAuthorizationManager 内的源文件添加(拖放)到你的工程。
  3. 导入 XZAuthorizationManager.h

特性

  • 简洁,只需一个方法,从此告别繁琐的权限申请。

示例代码

[[XZAuthorizationManager manager] requestAuthorization:(XZAuthorizationTypeAll) completion:^(XZAuthorizationStatus status, XZAuthorizationType authorizationType) {
    if (status == XZAuthorizationStatusAuthorized) {
        NSLog(@"授权成功");
    } else {
        NSString *statusString = (status == XZAuthorizationStatusDenied ? @"Denied" : @"Restricted");
        switch (authorizationType) {
            case XZAuthorizationTypeLocationAlways:
                NSLog(@"XZAuthorizationTypeLocationAlways 授权失败: %@", statusString);
                break;
            case XZAuthorizationTypeAlbum:
                NSLog(@"XZAuthorizationTypeAlbum 授权失败: %@", statusString);
                break;
            case XZAuthorizationTypeLocationWhenInUse:
                NSLog(@"XZAuthorizationTypeLocationWhenInUse 授权失败: %@", statusString);
                break;
            case XZAuthorizationTypeCamera:
                NSLog(@"XZAuthorizationTypeCamera 授权失败: %@", statusString);
                break;
            case XZAuthorizationTypeMicrophone:
                NSLog(@"XZAuthorizationTypeMicrophone 授权失败: %@", statusString);
                break;
            default:
                break;
        }
    }
}];

系统要求

==============
该库最低支持 iOS 7.0Xcode 7.0

许可证

==============
XZTheme 使用 MIT 许可证,详情见 LICENSE 文件。

The CocoaPods Master Repo

This repository contains the public CocoaPods specifications.

Links

License

These specifications and CocoaPods are available under the MIT license.

Latest podspec

{
    "name": "XZAuthorizationManager",
    "version": "1.0.1",
    "summary": "iOS App Authorization Manager.",
    "description": "XZAuthorizationManager is an iOS platform authorization managementu3002",
    "homepage": "https://github.com/mlibai/XZAuthorizationManager",
    "license": "MIT",
    "authors": {
        "mlibai": "[email protected]"
    },
    "platforms": {
        "ios": "7.0"
    },
    "source": {
        "git": "https://github.com/mlibai/XZAuthorizationManager.git",
        "tag": "1.0.1"
    },
    "source_files": [
        "XZAuthorizationManager",
        "XZAuthorizationManager/*.{h,m}"
    ],
    "public_header_files": "XZAuthorizationManager/*.h",
    "frameworks": "UIKit",
    "requires_arc": true
}

Pin It on Pinterest

Share This