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

Creating a Transaction

init()

Creates a transaction.

init(animation: Animation?)

Creates a transaction and assigns its animation property.

Managing Animations

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.

Getting Information About a Transaction

var isContinuous: Bool

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

Executing Transactional Closures

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

Executes a closure with the specified transaction and returns the result.

See Also

Change Management

protocol DynamicProperty

An interface for a stored variable that updates an external property of a view.