Can somebody tell me what is wrong with this "quard" statement?

I'm working with the "Start Developing iOS Apps (Swift) and in the Work with View Controllers I'm having a problem with the "guard let" in the following func.

func imagePickerController(_ picker: UIImagePickerController, didFinishPickingMediaWithInfo info: [String : Any]) {

// The info dictionary may contain multiple representations of the image. You want to use the original.
Code Block
"guard let" selectedImage = info[UIImagePickerControllerOriginalImage] as? UIImage else {
fatalError("Expected a dictionary containing an image, but was provided the following: \(info)")
}
// Set photoImageView to display the selected image.
photoImageView.image = selectedImage
// Dismiss the picker.
dismiss(animated: true, completion: nil)
}

The error I receive is: "Cannot convert value of type 'UIImagePickerController.InfoKey' to expected argument type 'String'".

I think I may have a version issue. Running Xcode 11.5 with this tutorial.

You have written your guard let statement with double quotes around it. Remove the quotes so it is not seen as a string by the compiler.
Just don't put quotes around guard let.

Hello, did this problem get fixed? Removal of the "" around the guard let doesn't make any difference in mine, and still returns the same error. Then allowing all the auto fix options to play through then lets the app run and the user can click onto an image but this image does not appear anywhere.

thanks.

p.s. this is my first attempt at swift...

Removal of the "" around the guard let doesn't make any difference
in mine, and still returns the same error.

Removing the quotes is definitely necessary but it may not be sufficient. Can you post the current state of your code? Use a code block (via the <> button) to make it easier to read.

Share and Enjoy

Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@apple.com"
Can somebody tell me what is wrong with this "quard" statement?
 
 
Q