View

public extension View
  • Calls the completion handler whenever an animation on the given value completes. For this the value has to be changed within a withAnimation block otherwise the completion block will not be called.

    Declaration

    Swift

    func onAnimationCompleted<Value>(for value: Value, completion: @escaping (_ value: Value) -> Void) -> some View where Value : VectorArithmetic

    Parameters

    value

    The current value when the completion block is called.

    completion

    The completion callback to call once the animation completes.

    value

    The current value when the completion block is called.

    Return Value

    A modified View instance with the observer attached.

  • Calls the action when the given view has fully transitioned in. The action will be performed after the transition animation has finished, but will only be performed when the transition is animated.

    Declaration

    Swift

    func onDidAppear(_ action: @escaping NavigationViewLifecycleAction) -> some View

    Parameters

    action

    The action to perform after the animation has finished.

    Return Value

    The modified view with the applied modifier.