Commit f4088783 authored by pete谢兆麟's avatar pete谢兆麟

Merge commit '1d098fd5' into xiezhaolin

parents fbab3ea7 1d098fd5
...@@ -85,8 +85,10 @@ class YHMyPermissionSettingVC: YHBaseViewController { ...@@ -85,8 +85,10 @@ class YHMyPermissionSettingVC: YHBaseViewController {
func requestPermission() { func requestPermission() {
// 1)获取网络状态并更新
updateNetWorkStatus() updateNetWorkStatus()
// 获取相册权限
// 2)获取相册权限
requestPhotoLibraryPermission { requestPhotoLibraryPermission {
[weak self] grant in [weak self] grant in
guard let self = self else { return } guard let self = self else { return }
...@@ -100,7 +102,7 @@ class YHMyPermissionSettingVC: YHBaseViewController { ...@@ -100,7 +102,7 @@ class YHMyPermissionSettingVC: YHBaseViewController {
} }
} }
// 获取相机权限 // 3)获取相机权限
requestCameraPermission { requestCameraPermission {
[weak self] grant in [weak self] grant in
guard let self = self else { return } guard let self = self else { return }
...@@ -129,7 +131,13 @@ class YHMyPermissionSettingVC: YHBaseViewController { ...@@ -129,7 +131,13 @@ class YHMyPermissionSettingVC: YHBaseViewController {
case .notDetermined: case .notDetermined:
// 尚未确定,请求授权 // 尚未确定,请求授权
completion(false) PHPhotoLibrary.requestAuthorization {
authorizationStatus in
self.requestPhotoLibraryPermission {
granted in
completion(granted)
}
}
@unknown default: @unknown default:
completion(false) completion(false)
...@@ -150,7 +158,10 @@ class YHMyPermissionSettingVC: YHBaseViewController { ...@@ -150,7 +158,10 @@ class YHMyPermissionSettingVC: YHBaseViewController {
case .notDetermined: case .notDetermined:
// 尚未确定,请求授权 // 尚未确定,请求授权
completion(false) AVCaptureDevice.requestAccess(for: .video) {
granted in
completion(granted)
}
@unknown default: @unknown default:
completion(false) completion(false)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment