.transition modifier defines how to (Transitions tutorial goes into more detail)
● add View into the screen
● remove View from the screen
Transition Types
Slide - slide in the view from the leading (left) side and remove it towards the trailing (right) side
Move - slide in from the specified direction and remove it from the same direction (top, bottom, leading, trailing)
Offset - like the move transition but you can set your own x and y coordinate
Opacity - fade in the view when inserted and fade out the view when removed
Scale - insert the view FROM the scale specified and reverse the effect when removed
Syntax
.transition(AnyTransition.slide)
.transition(AnyTransition.move(edge: .top))
.transition(AnyTransition.move(edge: .bottom))
.transition(AnyTransition.move(edge: .leading))
.transition(AnyTransition.move(edge: .trailing))
.transition(AnyTransition.offset(x: 100, y: 100))
.transition(AnyTransition.opacity)
.transition(AnyTransition.scale(scale: 10))
.transition(AnyTransition.slide) .transition(AnyTransition.offset(x: 100, y: 100))
.transition(AnyTransition.move(edge: .top)) .transition(AnyTransition.move(edge: .bottom))