ScrollPhase

A type that describes the state of a scroll gesture of a scrollable view like a scroll view.

EnumerationiOS 18.0+macOS 15.0+tvOS 18.0+watchOS 11.0+visionOS 2.0+ScrollPhase in SwiftUI

Declaration

React
type ScrollPhase = SwiftOpaque<'ScrollPhase'>;
Swift
@frozen enum ScrollPhase

Overview

A scroll gesture can be in one of four phases: - idle: No active scroll is occurring. - panning: An active scroll being driven by the user is occurring. - decelerating: The user has stopped driving a scroll and the scroll view is decelerating to its final target. - animating: The system is animating to a final target as a result of a programmatic animated scroll from using a ScrollViewReader or View.scrollPosition(id:anchor:) modifier.

SwiftUI provides you a value of this type when using the View.onScrollPhaseChange(_:) modifier.

From Apple’s SwiftUI documentation. Code samples there are Swift.

Used by

See also

More in Animation.