Lecture 6: Animation

preview_player
Показать описание

In SwiftUI, any changes to ViewModifiers or Shapes can be animated. Views can animate changes either implicitly (using the animate declaration) or explicitly (by wrapping a withAnimation function call around code that might cause changes, most notably Intent functions in the ViewModel) and can control the duration and “curve” of the animation. The “arrival and departure” of Views on screen can also be animated using the transition declaration (which declares which ViewModifiers to use to draw Views before/after they arrive/depart from the screen). In Memorize, the Cardify ViewModifier and the Pie Shape are both made Animatable and animation is applied throughout.
Рекомендации по теме