DevTechie
Published in

DevTechie

Offset Animation in SwiftUI

Photo by Justin Schwartfigure on Unsplash

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.

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store