UIImagePickerController kUTTypeMovie 获取视频 iOS 11 权限问题解决

在iOS 11以上的版本,使用 UIImagePickerController获取相册视屏,权限弹框延时弹出或者不弹出导致崩溃的解决方法;
但是,最好在有时间的情况下,还是别在使用该方法获取视频;使用PH完成!
[PHPhotoLibrary requestAuthorization:^(PHAuthorizationStatus status) {
if ([UIImagePickerController isSourceTypeAvailable:type]) {
if ([self showCameraOrAssetlibraryLimit:type]) {
YTImagePickerController *picker = [[YTImagePickerController alloc] init];
picker.delegate = self;
picker.allowsEditing = YES;
picker.sourceType = type;
// picker.cameraDevice = UIImagePickerControllerCameraDeviceRear;
picker.mediaTypes = @[(NSString *)kUTTypeMovie];
picker.videoQuality = UIImagePickerControllerQualityTypeHigh;
// picker.cameraCaptureMode = UIImagePickerControllerCameraCaptureModeVideo;
[weakSelf presentViewController:picker animated:YES completion:nil];
}
}
}];

你可能感兴趣的:(UIImagePickerController kUTTypeMovie 获取视频 iOS 11 权限问题解决)