NavigationAnimationDelegate
open class NavigationAnimationDelegate : NSObject
NavigationAnimationDelegate is used as the delegate of a NavigationCoordinator’s rootViewController to allow for push-transitions to specify animations.
NavigationAnimationDelegate conforms to the UINavigationControllerDelegate protocol
and is intended for use as the delegate of one navigation controller only.
Note
Do not override the delegate of a NavigationCoordinator’s rootViewController. Instead use the delegate property of the NavigationCoordinator itself.-
The velocity threshold needed for the interactive pop transition to succeed
Declaration
Swift
open var velocityThreshold: CGFloat { get } -
The transition progress threshold for the interactive pop transition to succeed
Declaration
Swift
open var transitionProgressThreshold: CGFloat { get }
-
See UINavigationControllerDelegate documentation for further reference.
Declaration
Swift
open func navigationController(_ navigationController: UINavigationController, interactionControllerFor animationController: UIViewControllerAnimatedTransitioning ) -> UIViewControllerInteractiveTransitioning?Parameters
navigationControllerThe delegate owner.
animationControllerThe animationController to return the interactionController for.
Return Value
If the animationController is a
TransitionAnimation, it returns its interactionController. Otherwise it requests an interactionController from the NavigationCoordinator’s delegate. -
See UINavigationControllerDelegate documentation for further reference.
Declaration
Swift
open func navigationController(_ navigationController: UINavigationController, animationControllerFor operation: UINavigationController.Operation, from fromVC: UIViewController, to toVC: UIViewController) -> UIViewControllerAnimatedTransitioning?Parameters
navigationControllerThe delegate owner.
operationThe operation being executed. Possible values are push, pop or none.
fromVCThe source view controller of the transition.
toVCThe destination view controller of the transition.
Return Value
The destination view controller’s animationController depending on its
transitioningDelegate. In the case of apushoperation, it returns the toVC’s presentation animation. Forpopit is the fromVC’s dismissal animation. If there is no transitioningDelegate or the operationnoneis used, it uses the NavigationCoordinator’s delegate as fallback. -
See UINavigationControllerDelegate documentation for further reference.
Declaration
Swift
open func navigationController(_ navigationController: UINavigationController, didShow viewController: UIViewController, animated: Bool)Parameters
navigationControllerThe delegate owner.
operationThe operation being executed. Possible values are push, pop or none.
viewControllerThe target view controller.
-
See UINavigationControllerDelegate documentation for further reference.
Declaration
Swift
open func navigationController(_ navigationController: UINavigationController, willShow viewController: UIViewController, animated: Bool)Parameters
navigationControllerThe delegate owner.
operationThe operation being executed. Possible values are push, pop or none.
viewControllerThe view controller to be shown.
-
See UIGestureRecognizerDelegate documentation for further reference.
Note
This method alters the target of the gestureRecognizer to either its former delegate (UIKit default) or this class depending on whether a pop animation has been specified.
Declaration
Swift
open func gestureRecognizerShouldBegin(_ gestureRecognizer: UIGestureRecognizer) -> BoolParameters
gestureRecognizerThe gesture recognizer this class is the delegate of. This class is used as the delegate for the interactivePopGestureRecognizer of the navigationController.
Return Value
This method returns true, if and only if
- there are more than 1 view controllers on the navigation controller stack (so that it is possible to pop a viewController) and
- it is the interactivePopGestureRecognizer to call this method
-
This method handles changes of the navigation controller’s
interactivePopGestureRecognizer.This method performs the top-most dismissalAnimation and informs its interaction controller about changes of the interactivePopGestureRecognizer’s state.
Declaration
Swift
@objc open func handleInteractivePopGestureRecognizer(_ gestureRecognizer: UIGestureRecognizer)Parameters
gestureRecognizerThe interactivePopGestureRecognizer of the
UINavigationController.
-
This method sets up the
interactivePopGestureRecognizerof the navigation controller to allow for custom interactive pop animations.This method overrides the delegate of the
interactivePopGestureRecognizertoself, but keeps a reference to the original delegate to enable the default pop animations.Declaration
Swift
open func setupPopGestureRecognizer(for navigationController: UINavigationController)Parameters
navigationControllerThe navigation controller to be set up.
View on GitHub
NavigationAnimationDelegate Class Reference