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 -> ResultMentioned in
Discussion
This function sets the given Animation as the animation property of the thread’s current Transaction.