2021
The lectures for the Spring 2021 version of Stanford University's course CS193p (Developing Applications for iOS using SwiftUI) are archived here. They are are all now out of date and you'll want to go to the Spring 2023 version instead.
For more, check out the About page.
Getting Started with SwiftUI
The first lecture jumps right into building the first application of the quarter: a card-matching game called Memorize. It will be the foundation for the first few weeks of course material.
MVVM
Conceptual overview of the architectural paradigm underlying the development of applications for iOS using SwiftUI (known as MVVM) and an explanation of a fundamental component of understanding the Swift programming language: its type system. Then both of these are applied to the Memorize application started in the first two lectures.
Properties Layout @ViewBuilder
Explore property observers, computed properties, @State and @ViewBuilder. The mechanisms behind how Views are layed out on screen are examined followed by a demo which chooses a better font for each card in Memorize depending on the space available. Along the way, apply better access control to Memorize's internal API.
ViewModifier Animation
The ViewModifier protocol is explained and then used to make it possible to turn any View into a Memorize card by "cardify-ing" it. The lecture then moves on to an in-depth look at animation and starts a comprehensive multi-lecture demonstration of animation by using implicit animations to make the emoji on a Memorize card spin around when it is matched.
EmojiArt Drag/Drop
New demo application: EmojiArt. Lots covered here, including enum, extensions, tuples, Drag and Drop, colors and images, and more. The Grand Central Dispatch (GCD) API is explained in preparation for a demo of multithreading in the next lecture.
Note: GCD has been mostly replaced by Swift's new built-in async API as of WWDC 2021.
Persistence Error Handling
A number of persistence topics (UserDefaults, the file system, Codable archiving, JSON) as well as how errors are handled in Swift. Make changes to an EmojiArt document persist and introduce a new ViewModel to EmojiArt called PaletteStore.
Publisher More Persistence
The Publisher protocol is used to implement a cleaner version of EmojiArt's background downloading code. CloudKit and CoreData are briefly explained (but not demoed). See the bonus lecture from 2020 below (Enroute, part 2) for a demo of CoreData.
UIKit Integration
Get EmojiArt working on iPhone. Includes some more toolbar work as well as understanding how to integrate UIKit functionality into a SwiftUI application.
The following two lectures (Enroute) were given in Spring 2020, but not in Spring 2021 (nor in Spring 2023). Some of the material covered (e.g. Picker and using Codable to pull data from a REST API) is still somewhat relevant (as of Spring 2021 anyway, though less-so in Spring 2023) but CoreData is being replaced with SwiftData and so the second of these two lectures is now out of date.
Enroute Picker Codable REST API
The first of two bonus lectures from 2020 covers Picker and creates a new demonstration application (Enroute) which pulls data from a REST API on the internet using the Codable mechanism shown earlier in the course.