Swift 3照片库

时间:2016-09-17 12:50:51

标签: ios swift swift3

我刚刚更新到Swift 3,我试图运行此代码

    @IBAction func selectProfilePhoto(_ sender: AnyObject) {

    imagePicker.sourceType = UIImagePickerControllerSourceType.photoLibrary
    imagePicker.mediaTypes = [kUTTypeImage as String]
    self.present(imagePicker, animated: true, completion: nil)
}

当我运行此代码时,它只是崩溃了!

0 个答案:

没有答案