I'm trying to add this to my Swift app, but I keep getting an error:
func imagePickerController(_ picker: UIImagePickerController, didFinishPickingMediaWithInfo info: [UIImagePickerController.InfoKey : Any]) {
if let selectedImage = info[.originalImage] as? UIImage {
imageView.image = selectedImage
} else {
print("Failed to retrieve the original image")
}
picker.dismiss(animated: true, completion: nil)
}
Error: Reference to member 'originalImage' cannot be resolved without a contextual type
Is this properly working with Swift 6?
I'm trying to add this to my Swift app, but I keep getting an error:
func imagePickerController(_ picker: UIImagePickerController, didFinishPickingMediaWithInfo info: [UIImagePickerController.InfoKey : Any]) {
if let selectedImage = info[.originalImage] as? UIImage {
imageView.image = selectedImage
} else {
print("Failed to retrieve the original image")
}
picker.dismiss(animated: true, completion: nil)
}
Error: Reference to member 'originalImage' cannot be resolved without a contextual type
Is this properly working with Swift 6?