SwSwift

Learn Swift – all lessons

16 lessons from beginner to advanced, building on each other and with code examples.

Beginner
1

Hello World, print & Strings

Your first Swift program, output, and string interpolation.

2

Variables, Constants & Types

let and var, type inference, and the most important basic types.

3

Conditions & Loops

if, switch with patterns, for-in, while, and ranges.

4

Functions & Argument Labels

Parameters, default values, return values, inout, and functions as values.

5

Arrays, Dictionaries & Sets

The three collection types, with value semantics and bounds checking.

6

Optionals

Swift's answer to null: a value is present or nil, enforced by the compiler.

Intermediate
7

Structs vs. Classes

Value types and reference types, methods, computed properties, and inheritance.

8

Enums with Associated Values

Enums that carry data: modeling states safely.

9

Protocols & Extensions

Describing behavior, default implementations, and extending existing types.

10

Closures & Higher-Order Functions

Anonymous functions, map/filter/reduce, and capturing values.

11

Error Handling

throws, try, do/catch, Result, and defer.

12

Swift Package Manager & Tests

Structuring projects, adding dependencies, and testing code.

Advanced
13

ARC, weak & Retain Cycles

How Swift manages memory and how you avoid memory leaks.

14

Generics & Property Wrappers

Reusable code for many types, associated types, and property wrappers.

15

async/await, Tasks & Actors

The modern concurrency model: structured concurrency without callback chains.

16

SwiftUI: The Core Idea

Declarative interfaces: views as a function of state.