Swift
For iPhone, iPad and Mac apps
Learn programming from scratch with Swift, Apple's modern language: from constants and types to optionals, collections, closures, structs and protocols. Every example shows exactly what the code prints. By the end you will understand how iPhone apps are built with SwiftUI and be ready to start your own project in Xcode.
Course content
Swift basics
BeginnerWrite your first program, meet constants, variables, types and strings, and teach your program to make decisions and repeat work.
- 1What is Swift? Your first programFind out what Swift is, where it is used and which tools you write it in, and write your first program with print.12 min
- 2Constants, variables, types and stringsStore values with `let` and `var`, learn Swift's basic types and type inference, and put values into strings with interpolation.15 min
- 3Conditions and loopsTeach your program to make decisions with `if` and `switch` and to repeat work with `for-in`, ranges and `while`.16 min
Data and functions
IntermediateHandle missing values safely with optionals, store data in collections and split your code into functions and closures.
- 4Optionals: when a value may be missingHandle the “no value” case safely in Swift with optionals: `nil`, `if let`, `guard let`, `??` and optional chaining.16 min
- 5Collections: arrays, dictionaries, setsStore many values in arrays, dictionaries and sets, change them and process them in one line with `map`, `filter` and `reduce`.18 min
- 6Functions and closuresSplit code into functions with argument labels, default values and return values. Then learn closures, their short forms and trailing closures.18 min
Your own types and apps
AdvancedCreate your own types with structs, classes, enums and protocols, handle errors and see how a screen is built with SwiftUI.
- 7Structs, classes and enumsCreate your own types with `struct`, `class` and `enum`: properties, methods, the difference between value and reference types, and enums with associated values.20 min
- 8Protocols, errors and SwiftUIGive types shared rules and new abilities with protocols and extensions, handle errors with `throws` and `do-try-catch`, and then see how a first screen is built with SwiftUI.22 min
iOS app development
AdvancedBuild screens with SwiftUI in Xcode, manage data flow, navigate between screens, load data from the internet and save it with SwiftData, then take your app through TestFlight to the App Store.
- 9Xcode and your first iOS appInstall Xcode, create a SwiftUI project, understand the project structure, see the screen in previews, and run the app in the simulator and on your own iPhone.20 min
- 10SwiftUI views and layoutAssemble a screen from small View structs: change the look with modifiers, arrange elements with VStack, HStack and ZStack, build a List and a Form, and use SF Symbols icons.22 min
- 11State and data flowKeep state in SwiftUI with `@State`, pass it to child views with `@Binding`, create a model with the `@Observable` macro, share it through `@Environment` and structure the app in the MVVM style.22 min
- 12Navigation and listsMove between screens with NavigationStack and navigationDestination, control the path in code, open sheets, and build editable lists from Identifiable items with ForEach.22 min
- 13Networking and persistenceTurn JSON into Swift types with Codable, load data from a server with URLSession and async/await, show the result on screen, and save notes on the device with SwiftData.25 min
- 14Publishing and best practicesGive your app a version and build number, sign it and upload it to App Store Connect, test it with TestFlight and publish it on the App Store; write tests with Swift Testing and check accessibility for VoiceOver and Dynamic Type.24 min