Swift essentials from values to structs
8 steps · about 4 h 35 min · Beginner
- Skim the whole language once (tutorial, Swift.org, 45 min)
A quick pass through every major feature gives you a map before the detailed chapters.
- Use constants, types and optionals (reference, Swift.org, 45 min)
Optionals appear in almost every Swift API, so learn to unwrap them safely from day one.
- Work with Unicode-correct strings (reference, Swift.org, 30 min)
Swift strings behave differently from most languages; knowing why avoids index bugs.
- Store data in arrays, sets and dictionaries (reference, Swift.org, 30 min)
Value-type collections and their mutability rules come up in every program.
- Branch, loop and switch on patterns (reference, Swift.org, 35 min)
Swift's switch matches patterns and must be exhaustive, which catches missing cases early.
- Write functions with labels and defaults (reference, Swift.org, 30 min)
Argument labels make Swift calls read like sentences; practise designing them well.
- Model choices with enums (reference, Swift.org, 30 min)
Enums with associated values replace many flags and loose strings with checked cases.
- Choose between structs and classes (reference, Swift.org, 30 min)
Value versus reference semantics is the key design decision in Swift; end on it.