Class Central is learner-supported. When you buy through links on our site, we may earn an affiliate commission.

Stanford University

CS193p - Developing Apps for iOS

Stanford University via Independent

Overview

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.

 

Syllabus

  • Lecture 1: 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.
  • Lecture 2: 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.
  • Lecture 3: 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.
  • Lecture 4: 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.
  • Lecture 5: 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.
  • Lecture 6: 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).
  • Lecture 7: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.
  • Lecture 8: 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.
  • Lecture 9: 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.
  • Lecture 10: 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.
  • Lecture 11: 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.
  • Lecture 12: 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.
  • Lecture 13: 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.
  • Lecture 14: 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.
  • Lecture 15: 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.
  • Lecture 16: 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.
  • 2020 Enroute Part 1: 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.
  • 2020 Enroute Part 2: 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.

Reviews

Start your review of CS193p - Developing Apps for iOS

Never Stop Learning.

Get personalized course recommendations, track subjects and courses with reminders, and more.

Someone learning on their laptop while sitting on the floor.