pro-swift-toc
pro-swift-toc
Preface 6
Welcome
Pattern Matching 11
Matching tuples
Matching loops
Matching optionals
Matching ranges
Matching enums and associated values
Matching types
Using the where keyword
Syntax 33
If and switch expressions
Guard
Nil coalescing
Lazy loading
Lazy singletons
Lazy sequences
Destructuring
Labeled statements
Nested types
Nested functions
Documentation markup
Types 79
Useful initializers
Strings
Enums
Arrays
Dictionaries
Sets
Tuples
Ranges and RangeSet
Generics
Key paths
www.hackingwithswift.com 3
References and Values 136
What’s the difference between structs and classes?
Why use structs?
Why use classes?
Immutability in structs and classes
Closures are reference types
Mixing classes and structs
Errors 191
Error fundamentals
Error propagation
Throwing functions as parameters
Typed throws
try vs try? vs try!
Assertions and preconditions
Never and fatalError()
4 www.hackingwithswift.com
fi
fl
Object-oriented Programming 266
Object-oriented programming
Encapsulation
Inheritance
Super methods
Polymorphism
Final classes
Static properties and methods
is-a vs has-a
Afterword 316
www.hackingwithswift.com 5