Structure

Transaction

The context of the current state-processing update.

Declaration

@frozen struct Transaction

Overview

Use a transaction to pass an animation between views in a view hierarchy.

The root transaction for a state change comes from the binding that changed, plus any global values set by calling withTransaction(_:_:) or withAnimation(_:_:).

Topics

Global Functions

func withTransaction<Result>(Transaction, () -> Result) -> Result

Executes a closure with this transaction set as the thread’s current transaction and returns the result.

Initializers

init()

Creates a transaction.

init(animation: Animation?)

Creates a transaction and assigns its animation property.

Instance Properties

var animation: Animation?

The animation, if any, associated with the current state change.

var disablesAnimations: Bool

A Boolean value that indicates whether views should disable animations.

var isContinuous: Bool

A Boolean value that indicates whether the transaction originated from an action that produces a sequence of values.