判断是否获取到手机相机权限
生活随笔
收集整理的這篇文章主要介紹了
判断是否获取到手机相机权限
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
? 實際運用場景:
上傳圖片,查看相機設備,使用相機 在做這些操作的時候先調用這段話
?
AVAuthorizationStatus authStatus =? [AVCaptureDevice authorizationStatusForMediaType:AVMediaTypeVideo];
? ? if (authStatus == AVAuthorizationStatusRestricted || authStatus ==AVAuthorizationStatusDenied)
? ? {
? ? ? ? UIAlertView *alertView = [[UIAlertView alloc] initWithTitle:@"提示" message:@"未獲得授權使用相機,請在iOS\"設置中\"-\"隱私\"-\"相機\"中打開" delegate:nil cancelButtonTitle:@"確定" otherButtonTitles:nil];
? ? ? ? [alertView show];
? ? ? ? return;
? ? }
轉載于:https://www.cnblogs.com/liaolijun/p/7808144.html
總結
以上是生活随笔為你收集整理的判断是否获取到手机相机权限的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 理想ONE发动机半年坏了6次!车主:30
- 下一篇: 全球部分芯片“速冻急停” 中芯国际表态: