在ios13中使用UIImagePickerController选择视频有问题吗?
let myImagePickerController = UIImagePickerController()
myImagePickerController.sourceType = .savedPhotosAlbum
myImagePickerController.mediaTypes = [ ( kUTTypeMovie ) as String ,( kUTTypeImage ) as String ]
myImagePickerController.delegate = self
myImagePickerController.isEditing = false
myImagePickerController.navigationBar.isHidden = true
myImagePickerController.modalPresentationStyle = .fullScreen
解决此问题的方法是
let myImagePickerController = UIImagePickerController()
myImagePickerController.sourceType = .savedPhotosAlbum
myImagePickerController.mediaTypes = [ ( kUTTypeMovie ) as String ,( kUTTypeImage ) as String ]
myImagePickerController.delegate = self
myImagePickerController.isEditing = false
myImagePickerController.navigationBar.isHidden = true
myImagePickerController.modalPresentationStyle = .fullScreen
if #available(iOS 11.0, *) {
myImagePickerController.videoExportPreset = AVAssetExportPresetPassthrough
}
就这样! ?