Contents

withAnimation(_:_:)

Returns the result of recomputing the view’s body with the provided animation.

Declaration

func withAnimation<Result>(_ animation: Animation? = .default, _ body: () throws -> Result) rethrows -> Result

Mentioned in

Discussion

This function sets the given Animation as the animation property of the thread’s current Transaction.

See Also

Adding state-based animation to an action