NavigationAnimation

public struct NavigationAnimation

A data struct with information for a transition animation used by the NavigationStackView.

  • The Z-Index (-1) to use by content which should be shown behind the other.

    Declaration

    Swift

    public static let zIndexOfBehind: Double
  • The Z-Index (1) to use by content which should be shown in front of the other.

    Declaration

    Swift

    public static let zIndexOfInFront: Double
  • Declaration

    Swift

    public init(
    	animation: Animation = .default,
    	defaultViewTransition: AnyTransition = .static,
    	alternativeViewTransition: AnyTransition = .static,
    	defaultViewZIndex: Double = zIndexOfBehind,
    	alternativeViewZIndex: Double = zIndexOfInFront
    )

    Parameters

    animation

    The animation curve to use when animating a transition.

    defaultViewTransition

    The transition to apply to the origin view. Defaults to static to keep the view visible during the transition.

    alternativeViewTransition

    The transition to apply to the destination view. Defaults to static to keep the view visible during the transition.

    defaultViewZIndex

    The Z-index to apply to the origin view during the transition. Defaults to -1 to show the default view behind the alternative view during animations.

    alternativeViewZIndex

    The Z-index to apply to the destination view during the transition. Defaults to 1 to show the alternative view in front of the default view during animations.

  • A transition animation suitable for a typical push animation.

    Declaration

    Swift

    static let push: NavigationAnimation
  • pop

    A transition animation suitable for a typical pop animation.

    Declaration

    Swift

    static let pop: NavigationAnimation
  • A transition animation suitable for a typical modal present animation.

    Declaration

    Swift

    static let present: NavigationAnimation
  • A transition animation suitable for a typical modal dismiss animation.

    Declaration

    Swift

    static let dismiss: NavigationAnimation
  • A transition animation used to blend the new view into the old view.

    Declaration

    Swift

    static let fade: NavigationAnimation