December 2015
Intermediate to advanced
400 pages
13h 3m
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, but 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 ...
Read now
Unlock full access