I'm making a basic iPhone only image editing app. The imagePickerController runs fine on all iPhones and iPads (in iPhone compatibility mode) running IOS 10 in the simulator, and all iPhones on IOS 9, but:
iPads in iPhone compatability mode on iOS 9 crash when an image is chosen from the picker. The debug console says the reason of the crash is:
fatal error: unexpectedly found nil while unwrapping an Optional value
func imagePickerController(_ picker: UIImagePickerController, didFinishPickingMediaWithInfo info: [String : Any])
image = info[UIImagePickerControllerOriginalImage] as! UIImage
}
In the code above, the first line inside the imagePickerController function is where the crash occurs.
My plist permissions are set correctly, and I shouldn't need to set the picker into a popover because its running in iPhone compatibility mode and also it works normally on iOS 10 iPads (in iPhone compatibility mode).
I'm running all of these tests in the simulator if that has any bearing, but I haven't been able to find a rhyme or reason for this iOS 9 specific crash. Any advice would be greatly appreciated.