Answer the question
In order to leave comments, you need to log in
I get the error "UIImage? is not convetrible to UIImage". How to work with UIImagePickerController in Swift 5?
I get this error "UIImage? is not convetrible to UIImage" in this line "if let possibleImage = info[.editedImage] as? UIImage {". Interested in swift 5.
private func imagePickerController(_ picker: UIImagePickerController, didFinishPickingMediaWithInfo info: [UIImagePickerController.InfoKey : Any]) {
var newImage: UIImage
if let possibleImage = info[.editedImage] as? UIImage {
newImage = possibleImage
} else if let possibleImage = info[.originalImage] as? UIImage {
newImage = possibleImage
} else {
return
}
// do something interesting here!
print(newImage.size)
dismiss(animated: true)
}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question