Learn Swift by doing — the language behind modern iOS, macOS, and beyond. Safe, expressive syntax and type inference, optionals that eliminate null crashes, functions and closures, value types versus reference types, protocol-oriented programming with generics, error handling, and modern concurrency with async/await and actors, plus how ARC manages memory.
Before you start
Any prior programming experience helps — if Swift is your first language, the Python course teaches the fundamentals gently. The concepts here transfer to any modern language.
Swift Basics
Constants and variables, type inference, string interpolation, and control flow. The safe, concise foundations of Swift — statically typed, but with the lightness of a scripting language.
Optionals
Swift’s answer to null crashes: a value is either present or nil, encoded in the type. Learn optional binding, guard, nil-coalescing, and optional chaining — the safe ways to work with maybe-missing values.
Functions & Closures
Functions with argument labels and defaults, and closures — self-contained blocks of code you pass around. Learn trailing closure syntax and higher-order functions like map and filter.
Structs, Classes & Enums
Swift’s three ways to model data, and the crucial distinction behind them: structs and enums are value types (copied), classes are reference types (shared). Choosing correctly prevents a whole category of bugs.
Protocols & Generics
Protocol-oriented programming is the heart of Swift. Define capabilities with protocols, share default behavior with protocol extensions, and write reusable, type-safe code with generics.
Error Handling
Swift handles recoverable failures with typed errors you throw and catch. Learn throwing functions, do/try/catch, the try? and try! variants, and modeling errors as enums.
Concurrency & Memory
Write asynchronous code that reads sequentially with async/await, protect shared state with actors, and understand how ARC manages memory — including the weak references that break retain cycles.