Diploma in Apple Development 🍎👩🏻‍💻: Coding Two: Lecture Lecture 11: What is going on with SwiftUI under the hood.
Back to slide index.
👋🏻 Hi!
First, don't forget to confirm your attendance using the Seats Mobile app!
Second, I'm going to start every lecture with a meditation from the fantastic Sitting Still Like a Frog book, all read by Myla Kabat-Zinn. If you don't want to participate that's completely fine.
This is the final Coding lecture for the whole year. We are going to go into how SwiftUI works under the hood. Apple hasn't officially told us what is going on, so we are going to have to be detectives and piece it all together. We are going to go in this order:
What a Tuple is in Swift. What does Wikipedia say a Tuple is?. What does a Tuple mean in Swift?. How does a Tuple Expression work compared to all other valid Expressions in Swift?. We are going deep into how Swift itself works.
What a Key Path expression is in Swift and how it used in a For Each statement. What does the Swift Book say about Key Path Expressions? Now for a pair of articles that helped me understand them: "Understanding KeyPaths in Swift" by Andy Ibanez and "Why does \.self work for ForEach?" by Paul Hudson.
What the some, any and Any keywords mean (remember Uppercase and lowercase can be important in programming languages!). Apple article on Opaque and Boxed Protocol Types - aka some and any. More detail on some aka Opaque Type, any aka Boxed Protocol Types and finally more information about the Any Type.
What property wrappers are and how you can use them for data management in SwiftUI. Let's see what the Swift book says about property wrappers. Let's continue with this introductory article on Model Data from Apple. Note that @State, @Binding and @Environment are all property wrappers! N.B. @Observable is a macro, find out more here.
What a ViewBuilder is in SwiftUI.
What a Result Builder is in Swift. For more information on Result Builders and how SwiftUI another Apple API's are designed and implemented, see the following WWDC sessions: "Write a DSL in Swift using result builders" and "Modern Swift API Design".
Let's watch this talk from Chris Eidhof: "Take a deep dive into SwiftUI", then take a look at The SwiftUI Field Guide introduction.
Let's watch another talk from Chris Eidhof: "A day in the life of a SwiftUI view". BTW, this article shows what the actual SwiftUI attribute graph looks like!
Thanks! As always, please review all today's content as homework. Next week will be mock Practical Exam and Multiple Choice Tests.
Back to slide index.