Lecture 5: ViewBuilder + Shape + ViewModifier
Stanford Stanford
1.9M subscribers
48,964 views
0

 Published On Jun 1, 2020

The fifth iOS lecture given at Stanford during Spring quarter of 2020 expanded coverage of topics related to drawing on screen 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.

This lecture starts with an aside about access control (marking APIs so that they are revealed to the right “audiences” within an application) which is then applied throughout Memorize. After the Shape protocol is discussed, a “pie shape” is added to the background of Memorize cards in demo in preparation for animating a countdown timer for scoring. A custom ViewModifier is also added to Memorize to “cardify” any View (i.e. make the View appear to be on a card that has a front and a back).

show more

Share/Embed