Offset Animation in SwiftUI
SwiftUI views have many animatable properties. Today we will look at Offset.
We use offset(x:y:)
to shift the displayed contents by a specified amount in the x
and y
params.
Note that while offset shifts the view, the original dimensions of the view aren’t changed by offsetting the contents.