I can understand the statement, but as is good enough to cast any type, why followed by a question mark like:
if let foo = object as? String
It's really bugging me. Does it mean object is optional or the return value of the variable foo is an optional string type? Or it really means nothing just a language syntax? It must means something otherwise why is it there in the first-place? What does it mean? The question mark after word as in the if let statement.
I did search and can't find any.
i was confused course i know object is already an optional and be assigned to variable foo then if let unwrap it if it can unwrap,or jumped out the following statement.
so the if let unwrapping procedure is happening after as? type casting right? after as?casting a optional string from the example, then if let is unwrapping that not the optional object class assigned to the variable.