https://cs193p.sites.stanford.edu/ Skip to main content Skip to secondary navigation Stanford University(link is external) Stanford CS193p - Developing Apps for iOS Search this site [ ] Submit Search Menu * Home * Xcode 12 / iOS 14 / Big Sur * About Main Content The lectures for the Spring 2020 version of Stanford University's course CS193p (Developing Applications for iOS using SwiftUI) were delivered to our students in an on-line fashion due to the novel coronavirus outbreak. Stanford has made these lecture videos available to all by posting them on its 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.). For more, check out the About page. Also check out the Xcode 12 page to see how some the latest changes to SwiftUI could be applied to the lecture materials after the quarter ended. Demo Screen Capture Lecture 1 Course Logistics and Intro to SwiftUI After going over the mechanics of how the course works, this first lecture dives right into creating an iOS application (a card-matching game called Memorize). The Xcode development environment is used to demonstrate the basics of SwiftUI's declarative approach to composing user-interfaces. Watch Video Slides MVVM Graphic Lecture 2 MVVM and the Swift Type System Conceptual overview of the architectural paradigm underlying the development of applications for iOS using SwiftUI: MVVM. In addition, a key underpinning of the Swift Programming Language, its type system, is explained. The Memorize demonstration continues, incorporating MVVM. Watch Video Slides Reading 1 Assignment 1 Reactive Coding Example Lecture 3 Reactive UI Protocols Layout Now that MVVM has been applied to Memorize, we can use the reactive nature of SwiftUI to make the cards flip over by processing multitouch events, updating our Model through our ViewModel and having our UI stay in sync with our Model at all times. An important concept, protocols, is covered in more detail as well as the basics about how to lay out Views in the UI. Watch Video Slides Memorize App Laid Out in Grid Lecture 4 Grid enum Optionals The survey of the Swift type system completes with a discussion of enum. An important language construct, Optionals, is both explained in slides and then demonstrated in Memorize as we fully implement the logic of the game. Watch Video Slides GridLayout.swift Reading 2 Assignment 2 Cardified Circle Lecture 5 ViewBuilder Shape ViewModifier Access Control. More about drawing, including the @ViewBuilder construct for expressing a conditional list of Views, the Shape protocol for custom drawing and ViewModifier, a mechanism for making incremental modifications to Views. Watch Video Slides Animated Cards Lecture 6 Animation @State (temporary state in a View) and property observers. Deep dive into animation, including implicit vs. explicit animations, transitions, Shape animations, animating ViewModifiers and more. Animate flipping of cards, new game and "pie" bonus countdown. Watch Video Slides Reading 3 Assignment 3 [l7still] Lecture 7 Multithreading EmojiArt A brand new demo, EmojiArt, is embarked upon, starting off with a review of MVVM and then employing API such as ScrollView, UIImage and Drag & Drop. After the concept of multithreading is covered, it is used to prevent blocking the UI while fetching a background image from the network. Watch Video Slides EmojiArtExtensions.swift Demo Code [l8still] Lecture 8 Gestures JSON A couple of persistence topics (UserDefaults API and JSON encoding/ decoding) are covered as well as the conceptual underpinnings of multi-touch gesture handling. EmojiArt is then enhanced to persist changes and to support pinching and dragging multi-touch gestures to zoom in and out and pan on the document. Watch Video Slides AnimatableSystemFontModifier.swift Demo Code Assignment 4 Assignment 5 Lecture 9 Still Lecture 9 Data Flow Property wrappers (like @Published, @EnvironmentObject, @Binding) are discussed along with Publishers. EmojiArt then uses these to autosave itself and to support choosing between multiple palettes of emoji. Watch Video Slides EmojiArtDocumentPalette.swift Demo Code Lecture 10 Still Lecture 10 Modal Presentation and Navigation Expanding the scope of a UI using modal presentation techniques and navigation. Getting text from the user via a TextField. Understanding the KeyPath type. Storing multiple EmojiArt documents. Watch Video Slides EmojiArtDocumentStore.swift EditableText.swift Demo Code Assignment 6 Picker Demo Lecture 11 Enroute Picker The first of (the final) four lectures to cover topics for students to use in their final projects. Picker. Introduction of the Enroute demo code-base. Watch Video Slides Demo Code Enroute Data Model Lecture 12 Core Data The Core Data object-oriented database. Demo adds Core Data to Enroute. Watch Video Slides Demo Code Emoji Art Document Viewer Lecture 13 Persistence CloudKit and filesystem access. Store EmojiArt documents in the filesystem. Watch Video Slides Demo Code Enroute Map Lecture 14 UIKit Integration Integrating pre-SwiftUI iOS code into SwiftUI. Add maps to Enroute. Change EmojiArt background to an image taken with the camera. Watch Video Slides Enroute Demo Code EmojiArt Demo Code Sunset view from Stanford Campus Stanford University * Stanford Home(link is external) * Maps & Directions(link is external) * Search Stanford(link is external) * Emergency Info(link is external) * Terms of Use(link is external) * Privacy(link is external) * Copyright(link is external) * Trademarks(link is external) * Non-Discrimination(link is external) * Accessibility(link is external) (c) Stanford University. Stanford, California 94305.