Search code examples
iosswiftuiimagepickercontrollerios10

UIImagePickerController crashes on iOS10


On presenting UIImagePickerController with photo library source on iOS10, my app crashes.

On iOS10 with camera source and on iOS9 with photo library and camera sources, the app does not crash.

The app is written in Swift 2.2 and built by Xcode 7.3.1.

Why does the crash occur?

let imagePicker = UIImagePickerController()
imagePicker.sourceType = .PhotoLibrary
imagePicker.allowsEditing = true
imagePicker.delegate = self
self.presentViewController(imagePicker, animated: true, completion: nil)

stack trace


Solution

  • I solved the crash by updating to the latest Xcode version. The problem has been discussed here as well: https://github.com/Leanplum/Leanplum-iOS-SDK/issues/12