Получаю такую ошибку "UIImage? is not convetrible to UIImage" в этой строке " if let possibleImage = info[.editedImage] as? UIImage {". Интересует именно 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)
}