Swift3.0 & Xcode8解决present(u
2016-08-15 本文已影响161人
07212a79db66
在xcode8-beta版本中访问照片库的时候如下面的代码,会出现闪退的情况
//判断能否打开相册
if !UIImagePickerController.isSourceTypeAvailable(.photoLibrary) {
print("不能打开相册")
return
}
// 2.创建图片选择器
let vc = UIImagePickerController()
vc.delegate = self
present(vc, animated: true, completion: nil)
解决方法:需要在info.plist里面配置一下

再次运行,闪退问题得到解决.