Summary

While the concept of optional types, as used in the Swift language, might seem a little foreign at first, the more you use them the more they will make sense. One of the biggest advantages with optional types is we get additional compile time checks that alert us if we forget to initialize non-optionals prior to using them.

The one thing to take away from this chapter is the concept of what optionals are. To reinforce this concept, let's review a couple of paragraphs from this chapter.

It is very important to understand that nil in Swift is very different than nil in Objective-C or other C-based languages. In Objective-C, nil is a pointer to a non-existent object; however, in Swift, nil is an absence of a value. This concept is very important ...

Get Mastering Swift 3 now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.