The lectures for the Spring 2021 version of Stanford University's course CS193p (Developing Applications for iOS using SwiftUI) were once again delivered to our students in an on-line fashion due to the novel coronavirus outbreak. You can watch them all on Stanford's YouTube channel (links below). This website was set up to give everyone access to the supporting material that was distributed to students during the quarter (homework, demo code, etc.).
The curriculum is substantially similar to the Spring 2020 version, so if you have already watched that version, scrubbing through the 2021 videos might be of some value since there were quite a lot of enhancements made to SwiftUI since 2020.
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.

Learning More about SwiftUI
Development on Memorize continues. Creating reusable components (a Card in the game) and combining them to make more complex user-interfaces.

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.

More MVVM enum Optionals
The MVVM architecture is fully applied to Memorize. The important Swift concepts of enums and Optionals are covered and used to finish off the game logic of the Memorize game.

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.

Protocols Shapes
Discussion of what is perhaps the most important type in Swift: a protocol. The demo combines the concepts of generics and protocols to make the cards better use the space available on screen. Finally the Shape protocol is explained and the pie-shaped countdown timer is added to Memorize (but not yet animated).

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.

Animation Demo
The demonstration of animation continues by showing how to animate the shuffling, dealing and flipping of cards along with the cards' appearance and disappearance. The pie-shaped countdown timer added in a previous lecture is also animated.

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.

Gestures
After demonstrating how to use GCD to keep the downloading of the background image from the internet from blocking the responsiveness of the UI, multitouch gestures are added to zoom in on and pan around in our EmojiArt document.
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.

Binding Sheet Navigation EditMode
The details about numerous property wrappers, including @State, @ObservedObject, @Binding, @Environment, @EnvironmentObject and @StateObject. Demo of many new SwiftUI elements, including TextField, Form, NavigationView, List, sheet, popover, Alert, EditMode and more. Enhance EmojiArt's palettes of emoji.

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.

Document Architecture
Demonstration of using SwiftUI's Document Architecture to turn EmojiArt into a multi-document application. Includes discussion of the App and Scene protocols, WindowGroup, DocumentGroup, @SceneStorage, @ScaledMetric, and more. Along the way, we add Undo/Redo to EmojiArt.

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.

Multiplatform (macOS)
Turn EmojiArt into a multi-platform application (i.e. both iOS and macOS). Demonstrates a variety of ways to share code across platforms.
The following two lectures (Enroute) were given in Spring 2020, but not in Spring 2021. The material covered (Picker, using Codable to pull data from a REST API, and CoreData) is still relevant (as of Spring 2021 anyway), so those lectures are included here as well. Updated demo code (to Xcode 12) is also included (the only significant change is to use the new SwiftUI application architecture, i.e. EnrouteApp.swift instead of SceneDelegate.swift, et. al.).

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.

Core Data
The second of two lectures from 2020 which use the Enroute demonstration application. Adds a CoreData database to Enroute to store historical flight data.
Demo Code (as shown in lecture)
Demo Code (updated for Xcode 12)