An optional differs from a regular variable or constant because it can have two states: It either has some value, or it has no value. When Apple listed the features of their newly announced Swift language, optionals seemed to be one of the concepts that Objective-C developers found the most challenging.
Why? A few possible reasons:
The misconception that in Objective-C we already have optional variables—assigning
nil to a pointer is possible, and that makes it an optional, right? Wrong!
The concept that, for there to be optional ...