scrollTransition

Applies the given transition, animating between the phases of the transition as this view appears and disappears within the visible region of the containing scroll view.

View ModifieriOS 17.0+macOS 14.0+tvOS 17.0+watchOS 10.0+

Overloads

2 ways to call compose().scrollTransition(). Each is one SwiftUI overload, picked by the arguments you pass.

React
compose().scrollTransition(
  configuration: SwiftUI.ScrollTransitionConfiguration | undefined,
  options: {
    axis?: SwiftUI.Axis | null;
    transition: (effect: SymbolicEffect, arg1: SymbolicValue) => SymbolicEffect;
  }
)
Swift
nonisolated func scrollTransition(
    _ configuration: ScrollTransitionConfiguration = .interactive,
    axis: Axis? = nil,
    transition: @escaping @Sendable (EmptyVisualEffect, ScrollTransitionPhase) -> some VisualEffect
) -> some View

Parameters

  • configuration*SwiftUI.ScrollTransitionConfiguration | undefined

    The configuration controlling how the transition will be applied. The configuration will be applied both while the view is coming into view and while it is disappearing (the transition is symmetrical).

  • options.axisSwiftUI.Axis | null

    The axis of the containing scroll view over which the transition will be applied. The default value of nil uses the axis of the innermost containing scroll view, or .vertical if the innermost scroll view is scrollable along both axes.

  • options.transition*(effect: SymbolicEffect, arg1: SymbolicValue) => SymbolicEffect

    A closure that applies visual effects as a function of the provided phase.

See also

More in Animation.