Skip to content
0:00 / 0:00

#swiftui#swift#optionals

Lecture 4: Grid + enum + Optionals

Stanford

2.2M subscribers • 18 videos on Hallway

YouTube
  • Recommended by 1 person: 1 in engineering communities.
  • May be out of date. Uploaded 6 years ago, in an area where tools change fast.

Intermediate. Assumes working knowledge.

78K views6 years ago1 recommendation

Programming languagesMobile developmentSwiftiOS and SwiftUI

Stanford CS193p covers building a custom Grid container in SwiftUI and explains Swift enums and Optionals.

The fourth video lecture given to Stanford students in Spring quarter of 2020 continues the Memorize demo by enhancing significantly the arrangement of the cards by creating our own container View called Grid (which also involves a number of basic functional programming concepts). Two more important Swift language features are discussed (enum and Optionals). And we finally get Memorize playing the card matching game itself (prominently featuring Optionals in our implementation). The survey of the Swift type system completes with a discussion of enum, a data structure with more functionality built into it than students are used to from other languages. While the reading assignments in this course are the primary way students learned the Swift language, occasionally a very important feature of the language is highlighted in lecture, as in this lecture where Optionals are explained in detail and then extensively demonstrated as we use them prominently in our implementation of the full game logic for Memorize in our Model.

Why it's here

1 person recommends this

What people say. Recommended as part of Stanford's highly regarded iOS development course.

u/Austin_Aaron_Conlonin r/swift • Recommends

Laying out a grid in SwiftUI