Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

UIImagePickerControllerOriginalImage is not working in ios 11.2.1

In what cases will I be sad? if I have set allowEditing as false.

func imagePickerController(_ picker: UIImagePickerController, didFinishPickingMediaWithInfo info: [String : Any]) {
    if let selectedImage = info[UIImagePickerControllerOriginalImage] as? UIImage {
        // I am happy :)
    } else {
        // I am sad :(
    }
    dismiss(animated: true, completion: nil)
}

(I got a crash in iOS 11.2.1 iPhone SE(as per Crashlytics), so confused if there are legit conditions where this can fail or it is just an iOS bug.)

like image 330
Nikhil Manapure Avatar asked Nov 28 '22 22:11

Nikhil Manapure


1 Answers

changed in IOS 12

  image.image = info[UIImagePickerController.InfoKey.originalImage] as? UIImage
like image 152
José Raúl Toledano R Avatar answered Dec 18 '22 16:12

José Raúl Toledano R