StateViewControllerTransitionCoordinator

public protocol StateViewControllerTransitionCoordinator

This protocol is used by StateViewController to animate state transitions. If you want to customize state transition animations on a per-viewcontroller basis you can make your content view controller classes conform to StateViewControllerTransitioning, or override stateTransitionCoordinator(for:) on each StateViewController

  • Returns the animation duration for a state transition of the provided view controller.

    Declaration

    Swift

    func stateTransitionDuration(for viewController: UIViewController, isAppearing: Bool) -> TimeInterval

    Parameters

    viewController

    StateViewController content view controller.

    isAppearing

    Whether the content view controller is appearing.

    Return Value

    An animation duration.

  • Notifies that a state transition will begin for the provided view controller.

    Declaration

    Swift

    func stateTransitionWillBegin(viewController: UIViewController, isAppearing: Bool)

    Parameters

    viewController

    StateViewController content view controller.

    isAppearing

    Whether the content view controller is appearing.

  • Notifies that a state transition did end for the provided view controller.

    • viewController: StateViewController content view controller.
    • isAppearing: Whether the content view controller is appearing.

    Declaration

    Swift

    func stateTransitionDidEnd(viewController: UIViewController, isAppearing: Bool)
  • Animations performed alongside the state transition of the provided view controller.

    Declaration

    Swift

    func animateAlongsideStateTransition(of viewController: UIViewController, isAppearing: Bool)

    Parameters

    viewController

    StateViewController content view controller.

    isAppearing

    Whether the content view controller is appearing.

  • Returns the animation delay for a state transition of the provided view controller.

    Declaration

    Swift

    func stateTransitionDelay(for viewController: UIViewController, isAppearing: Bool) -> TimeInterval

    Parameters

    viewController

    StateViewController content view controller.

    isAppearing

    Whether the content view controller is appearing.

    Return Value

    An animation delay.