Lecture 5: ViewBuilder + Shape + ViewModifier

in hive-196037 •  4 years ago 


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).


▶️ DTube
Authors get paid when people like you upvote their post.
If you enjoyed what you read here, create your account today and start earning FREE STEEM!