What you’ll learn
- Chapter 1One line after another – Printing and storing values – no prior knowledge needed.
Hello, Swift! · Remembering something with let · Changing values with var · What kind of value? - Chapter 2Calculating and deciding – Combining values and making decisions.
Calculating with numbers · Inserting values into text · Comparing · if and else - Chapter 3Several values, reusable code – Lists, repetitions and functions.
Arrays: a list · for: visiting every value · func: reusing code · Optionals: a value can be missing - Chapter 4Workshop: understand and build it yourself – Practise new building blocks with short explanations and your own programs.
A function returns a result · Dictionary: finding values by name · if let: using an existing value - Chapter 5New tools for your own ideas – Understand new concepts, fill them in and use them yourself.
struct: data that belongs together · enum and switch · guard let: providing a fallback early - Chapter 6Level up: your next practice chapter – Understand four new building blocks in small steps and use them yourself.
Tuples: a named pair of values · filter: keeping matching numbers · reduce: add up a list · A computed property - Chapter 7Master chapter: how real programs are built – Five building blocks from real projects – explained, connected, filled in and written by you.
while: repeat as long as it is true · map: converting every value · class: an object with behaviour · protocol: agreeing on an ability · sorted with a closure: your own order - Chapter 8Texts and collections – Text methods, split and joined, sets, compactMap and a word counter.
uppercased, hasPrefix and contains · split and joined · Set: every element only once · compactMap: sorting out nil · Boss: count words - Chapter 9Optionals and errors – Fallback values with ??, optional chaining, throws, try? and errors with data.
Fallback values with ?? · Optional chaining with ?. · Throwing errors: throws and catch · try? turns errors into nil · Boss: checking orders - Chapter 10Going deeper into types – mutating, extensions, enums with values, inheritance and protocol extensions.
mutating: changing structs · extension: extending types · enums with values attached · Inheritance with override · Boss: shapes with a protocol - Chapter 11Closures – Functions as values, map/filter/reduce with $0, sorting with your own rule, trailing closures and closures with memory.
Functions as values: closures · map, filter and reduce with $0 · Your own sort rule: sorted(by:) · Trailing closures and forEach · Boss: closures with memory - Chapter 12Protocols and generics – Contracts with protocol, default behaviour via extension, generic functions, Comparable and a generic stack.
Contracts with protocol · Default behaviour via extension · Generic functions · Making your own types comparable: Comparable · Boss: a generic stack - Chapter 13Dictionaries and switch – Look up values with a default, count, switch with ranges, conditions and tuples.
Looking things up: Dictionary · Counting words and printing them sorted · switch with ranges and where · switch over tuples · Boss: a stock with orders
Final project: Swift learning companion
A small program with a name, a score and motivating feedback.
How it works
Every lesson starts with short explanation pages. Then you practise with multiple-choice questions, fill-in-the-gap tasks, putting code in order and writing your own code – with hints and instant feedback. Free, without ads, on phone, tablet and PC.