November 2016
Intermediate to advanced
480 pages
14h 42m
English
At this point it is worth mentioning implicitly unwrapped optionals, though you will not make much use of them until we discuss classes and class initialization later. Implicitly unwrapped optionals are like regular optional types, with one important difference: You do not need to unwrap them. How is that the case? It has to do with how you declare them. Take a look at the code below, which refactors the example above to work with an implicitly unwrapped optional.
import Cocoa var errorCodeString: String! errorCodeString = "404" print(errorCodeString)
Here, the optional is declared with the !, which signifies that it is an implicitly unwrapped optional. The conditional is removed because using an ...
Read now
Unlock full access