2015
Treehouse
Pasan Premaratne
2:20
English
Two of Swift’s most novel features over Objective-C are the extended power of enumerations and the language features to deal with nil values. In this course we’re going to start by exploring enumerations in Swift - how they can define a set of related values, how they can carry associated values and how they make our code much safer by bringing in some wonderful compiler support. After that we take a look at optionals and dealing with nil values. Working with optionals can get pretty confusing so we understand why we do this in the first place and how we can unwrap the values when we need them.
Introduction to Enumerations
The Problem with Primitives
Modeling Finite Data
Creating an Enum - 1 objective
Getting Rid of Strings
Enums and Objects - 1 objective
Associated Enums
Enums with Associated Values - 1 objective
Methods on Enumerations
Enum Methods - 2 objectives
Introduction to Optionals
The Absence of Dat
Working with Optional Types
Optional Values - 1 objective
Optional Bindin
Nil Values in Collections - 1 objective
Downsides to Using If Let
Early Exits Using Guard
Recap on Optionals
Initializing Optional Values - 1 objective
Objects and Optionals
Enumerations With Raw Values
Initializing With Raw Values
Enums with Raw Values - 1 objective
Optional Chaining
Pattern Matching With Enums
Nil Coalescing Operator
Conclusion
Recap: Enumerations and Optionals - 12 questions
teamtreehouse.com/library/swift-20-enumerations-and-optionals
Download File Size:157.11 MB