April 2020
Beginner
316 pages
8h 20m
English
Another transition option we have is .move:
.transition(.move(edge: .top))
With this option and its accompanying animation, we can transition the view to the chosen edge of a view (.top, .leading, .bottom, .trailing).
Add this into your previous playground code and have a go; change the enum values to see all the options.
As we mentioned, the transition will only work as long as it is accompanied by an animation (in our case, an explicit animation). As we're not specifying an animation type, SwiftUI will automatically use the .default animation provided by the framework.
Let's take what we've learned from Chapter 13, Basic Animation in Views, and spruce up both our animation and transition in one go:
Button("Basic ...Read now
Unlock full access