视频捕获无法使用UIImagePickerController

时间:2016-07-20 19:43:22

标签: ios swift xcode

当按下按钮呈现imagePickerController时,我调用了一个函数,但是当必须拍摄视频时,应用程序崩溃,即使我在设备上运行(iPad 2)。

@IBAction func beginTest() {
    imagePicker =  UIImagePickerController()
    imagePicker.allowsEditing = false
    imagePicker.delegate = self
    imagePicker.sourceType = .Camera
    imagePicker.mediaTypes = [kUTTypeVideo as String, kUTTypeImage as String]
    if photoTests.contains(currentTestNum) {
        imagePicker.cameraCaptureMode = .Photo
    } else {
        imagePicker.cameraCaptureMode = .Video //exception thrown here.
    }
    presentViewController(imagePicker, animated: true, completion: nil)
}

0 个答案:

没有答案