My Profile Photo

Hao's Keeper


A blog to place memos


CS193P Lecture07-ViewModifier Animation

  1. by animation a Shape
  2. animation via their ViewModifiers
protocol ViewModifier {
   typealias Content // the type of the View passed to body(content:)
   func body(content: Content) -> some View {
      return some View that almost certainly contains the View 
   }
}

Important takeaways about Animation

Only changes can be animated. Changes to what?

  1. ViewModifier arguments
  2. Shapes
  3. The “existence” (or not) of a View in the UI
    (the comings and goings of Views)

Anmation is showing the user changes that have already happened (i.e. the recent past).