Your Site Title

iOS 权限

判断当前权限是否授限

#import <AVFoundation/AVFoundation.h> 

NSString *mediaType = AVMediaTypeVideo;//读取媒体类型  
AVAuthorizationStatus authStatus = [AVCaptureDevice authorizationStatusForMediaType:mediaType];//读取设备授权状态  
if(authStatus == AVAuthorizationStatusRestricted || authStatus == AVAuthorizationStatusDenied){  
		NSString *errorStr = @"应用相机权限受限,请在设置中启用";  
		[[HUDHelper getInstance] showErrorTipWithLabel:errorStr view:self.navigationController.view];  
		return;  
}

* AVAuthorizationStatusNotDetermined - 用户还没有对应用程序授权进行操作
* AVAuthorizationStatusRestricted - 还没有授权访问的照片数据。
* AVAuthorizationStatusDenied - 用户拒绝对应用程序授权
* AVAuthorizationStatusAuthorized - 用户对应用程序授权

Reference