reportTransition(to:stableMetadata:volatileMetadata:)
Reports a transition to a new state.
Declaration
final func reportTransition(to stateLabel: String?, stableMetadata: StableMetadata? = nil, volatileMetadata: VolatileMetadata? = nil)Parameters
- stateLabel:
A descriptive label for the new state, which must not be empty, or
nilto clear the active state. - stableMetadata:
An optional value that identifies the state together with
stateLabel. - volatileMetadata:
An optional value providing context likely to change within this state.
Mentioned in
Discussion
A transition occurs only when stateLabel or stableMetadata changes from the current state. If both are equal to the current values, this call is a no-op. Pass nil for stateLabel to indicate that no state is currently active, clearing any previously reported state. Passing an empty string for stateLabel is a fatal error. Any volatile metadata from the previous state is discarded when a new transition begins. Calling this method more frequently than user interaction timescales can trigger rate limiting, causing state updates to go unlogged.