| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Name | Name | Last commit date | ||
|---|---|---|---|---|
iOS授权集合,可同时请求多授权
pod 'DHAuthorizationManager'注意:必须将DHAuthorizationManager设置为强引用成员属性,授权弹框才能正常显示
#import "DHAuthorizationManager.h"
// 强引用
@property (nonatomic, strong) DHAuthorizationManager *authorizationManager;
// 初始化
self.authorizationManager = [[DHAuthorizationManager alloc] init];
// 请求权限校验
DHAuthorizationKey key = DHAuthorizationKeyCamera|DHAuthorizationKeyMicrophone;
[self.authorizationManager checkAuthorizationForKey:key withParameters:nil completion:^(NSDictionary <NSNumber *, NSNumber *> *_Nonnull result) {
// 授权结果result <@(DHAuthorizationKey), @(DHAuthorizationStatus)>
// do something...
}];#import "DHAuthorizationManager.h"
// 强引用
@property (nonatomic, strong) DHAuthorizationManager *authorizationManager;
// 初始化
self.authorizationManager = [[DHAuthorizationManager alloc] init];
self.authorizationManager.delegate = self;
// 请求权限校验
DHAuthorizationKey key = DHAuthorizationKeyCamera|DHAuthorizationKeyMicrophone;
[self.authorizationManager checkAuthorizationForKey:key withParameters:nil];
/** 代理反馈授权结果result <@(DHAuthorizationKey), @(DHAuthorizationStatus)> */
- (void)authorizationResult:(NSDictionary <NSNumber *, NSNumber *> *)result {
// do something...
}
| Back | FazBrowse Home | New Git URL |