How do you properly unwrap both normal and implicit optionals?
There seems to be confusion in this topic and I would just like to have a reference for all of the ways and how they are useful.
There are currently two ways to create optionals:
var optionalString: String?
var implicitOptionalString: String!
What are all the ways to unwrap both? Also, what is the difference between using !
and ?
during the unwrapping?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…