Swift learning path
Build a practical understanding of swift learning path from the underlying principles.
LANGUAGE · 52 ARTICLES
Go beyond memorizing syntax and understand why the language rules exist, from fundamentals and memory to concurrency and the Objective-C runtime.
Topic map
Build a practical understanding of swift learning path from the underlying principles.
Build a practical understanding of types and memory from the underlying principles.
Build a practical understanding of swift concurrency from the underlying principles.
Build a practical understanding of objective-c from the underlying principles.
Start here
A guided path from fundamentals to the next step.
The first hurdle when learning Swift is optionals. The question mark in String?, if let, guard let, !, and ??. With so many forms of syntax, memorizing each separately can easily turn the rules into a jumble.
Read articleIn the closures article, when we covered breaking retain cycles with [weak self], we left one question open. There is also unowned instead of weak—what is the difference, and when should you use it? To answer, we first need to look beneath the surface at how ARC actually works.
Read articleAt await, the function—not the thread—pauses. Here’s what suspension really means: the function stores its state on the heap and returns the thread to the cooperative pool, and why sequential await is not parallel execution.
Read articleAll articles
App sizes shrank after Swift 5 and iOS 12.2 shipped in 2019, thanks to ABI stability. This article covers how the Swift runtime moved from every app into the OS, along with module stability and the trade-offs of @frozen.
Read articleSynchronous vs. asynchronous concerns who tracks task completion, while blocking vs. non-blocking concerns whether control is returned immediately. This guide explains why the two independent axes produce all four 2×2 combinations, with Swift examples.
Read articleResources such as file handles and locks are meaningful only when unique, so they must not be copied. This guide explains how Swift 5.9’s ~Copyable encodes noncopyability in a type, covers borrowing, consuming, and inout, and clarifies where to use them.
Read articleSwift 5.9 macros are code-generation plugins embedded in the compiler. This overview covers how they receive syntax trees and return code, the freestanding (#) and attached (@) branches, and the cost of creating your own.
Read articleA struct's size is not a simple sum of its properties. This covers measured size, stride, alignment, padding, Optional's use of extra inhabitants, and 64-bit existential containers.
Read articleMethod calls compile as direct calls, vtable lookups, or objc_msgSend. This article explains why final and private improve performance, the trap in protocol extensions, and how to verify it with a profiler.
Read articleThe moment you attach an observer, KVO dynamically swaps the object's class with a subclass. This covers isa-swizzling, why class lies, and when notifications are not sent without going through the setter.
Read articleStructured concurrency answers who is responsible for ending asynchronous work. This article covers why child tasks cannot escape their parent scope, how cancellation propagates, and which guarantees you must manually reclaim with Task.detached.
Read articleTurning on Swift 6 mode unleashes concurrency errors, with Sendable at the center. This guide explains whether values may cross isolation boundaries and presents migration fixes in order: make them structs, make them immutable, or promote them to actors.
Read articleCategories cannot add ivars, but Associated Objects let you attach values. This article explains the side table stored beside objects, a complete category-property implementation, and memory policies where assign requires care.
Read articleDelegates and closures handle the same callback needs, but they have different trade-offs. This article implements the same example side by side, distills five practical differences, and summarizes how to choose based on event count, relationship lifetime, and whether a return value is needed.
Read articleAn actor is Swift’s fourth kind of type, protecting its own state. This guide explains how serialized access lets the compiler catch data races, including the classic reentrancy trap.
Read article