我刚刚更新到Swift 3,我试图运行此代码
@IBAction func selectProfilePhoto(_ sender: AnyObject) {
imagePicker.sourceType = UIImagePickerControllerSourceType.photoLibrary
imagePicker.mediaTypes = [kUTTypeImage as String]
self.present(imagePicker, animated: true, completion: nil)
}
当我运行此代码时,它只是崩溃了!