onScrollPhaseChange
Fires when SwiftUI's scroll phase changes (e.g., the user begins dragging, the scroll view starts decelerating, or scrolling settles to idle). The second argument is the scroll geometry sampled at the phase transition, useful for reading the final offset on settle without subscribing to per-frame onScrollGeometryChange.
onScrollPhaseChange(callback)
iOS 18+
| Parameter | Type |
|---|---|
callback | (phase: ScrollPhase, geometry: ScrollGeometry) => void |
Fires when SwiftUI's scroll phase changes (e.g., the user begins dragging, the scroll view starts decelerating, or scrolling settles to idle). The second argument is the scroll geometry sampled at the phase transition, useful for reading the final offset on settle without subscribing to per-frame onScrollGeometryChange.
Apply to a SwiftUI ScrollView (and other scrollable views). On iOS below 18.0 the modifier is a no-op.
Returns: ModifierConfig
See: Official SwiftUI documentation.
Works with
Sources
The original Expo docs for this page:
- onScrollPhaseChange (Modifiers) (
source-of-truth/versions/v57.0.0/sdk/ui/swift-ui/modifiers.md)