O'Reilly logo

Mastering Swift 4 - Fourth Edition by Jon Hoffman

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

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.

These two paragraphs give examples of what optionals actually are and how they are defined in Swift. It is import to understand this concept because optionals are used a lot in Swift.

In the next chapter we will be looking at Generics in Swift.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required