Match App - setCard optional unwrap

I noticed in the setCard method of the matchApp tutorial (day 25 of the iOS 28 day challenge, card flipping logic) Xcode forced me to unwrap the card object before I could access the imageName property to assign it to the frontImageView.image property. The app functions fine with the unwrapping, but flags this as an error if I don’t. See line of code below for the image assignment. I used a different name for the function parameter to remove any ambiguity. I didn’t see this pop up as an issue in Chris’s code during the video. Any idea why that would flag as needing to be unwrapped?

func setCard( _ cardPassed:Card){
self .card = cardPassed
frontImageView.image = UIImage(named: card!.imageName)

if your card is optional then it needs to unwrap to get the correct “data type”

if it is in an unwrapped state then its data type is “optional” instead of string or something