Swift essentials from values to structs

8 steps · about 4 h 35 min · Beginner

  1. 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.

  2. 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.

  3. Work with Unicode-correct strings (reference, Swift.org, 30 min)

    Swift strings behave differently from most languages; knowing why avoids index bugs.

  4. Store data in arrays, sets and dictionaries (reference, Swift.org, 30 min)

    Value-type collections and their mutability rules come up in every program.

  5. 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.

  6. Write functions with labels and defaults (reference, Swift.org, 30 min)

    Argument labels make Swift calls read like sentences; practise designing them well.

  7. Model choices with enums (reference, Swift.org, 30 min)

    Enums with associated values replace many flags and loose strings with checked cases.

  8. Choose between structs and classes (reference, Swift.org, 30 min)

    Value versus reference semantics is the key design decision in Swift; end on it.