ZoomTransitionController
class ZoomTransitionController : NSObject
A custom zoom transition for the transition from an ImageCollectionViewController
to an
ImagePagingCollectionViewController
when a cell is tapped. It also handles the retraction
transition. It was built to mimic the transition used in the native iPhone Photos app.
This custom animation was documented and explained in complete detail in the links provided below.
-
The delegate being animated from.
Declaration
Swift
weak var fromDelegate: ZoomAnimatorDelegate?
-
The delegate being animated to.
Declaration
Swift
weak var toDelegate: ZoomAnimatorDelegate?
-
The animator to use for the transition. This is a custom animation that zooms from one image to another.
Declaration
Swift
let animator: ZoomAnimator
-
The controller for the interactive transition during dismissal. Dragging up or down on the image initiates the interactive transition.
Declaration
Swift
let interactionController: ZoomDismissalInteractionController
-
A
Boolean
for if the transition is interactive or not. Defaults tofalse
.Declaration
Swift
var isInteractive: Bool
-
Undocumented
Declaration
Swift
override init()
-
Called when the transition begins for a presentation.
Declaration
Swift
func animationController(forPresented presented: UIViewController, presenting: UIViewController, source: UIViewController) -> UIViewControllerAnimatedTransitioning?
-
Called when the transition begins for dismissal. The to and from delegates need to be swapped.
Declaration
Swift
func animationController(forDismissed dismissed: UIViewController) -> UIViewControllerAnimatedTransitioning?
-
Update the transition controller for a presentation or dismissal. It decides hether or not to use the interactive controller. The interactive controller uses the same animator, though.
Declaration
Swift
func interactionControllerForDismissal(using animator: UIViewControllerAnimatedTransitioning) -> UIViewControllerInteractiveTransitioning?
-
Update the transition controller for a presentation or dismissal.
Declaration
Swift
func navigationController(_ navigationController: UINavigationController, animationControllerFor operation: UINavigationController.Operation, from fromVC: UIViewController, to toVC: UIViewController) -> UIViewControllerAnimatedTransitioning?
-
Update the transition controller for a presentation or dismissal. It decides hether or not to use the interactive controller. The interactive controller uses the same animator, though.
Declaration
Swift
func navigationController(_ navigationController: UINavigationController, interactionControllerFor animationController: UIViewControllerAnimatedTransitioning) -> UIViewControllerInteractiveTransitioning?
-
Tells the
interactionController
that the user panned.Declaration
Swift
func didPanWith(gestureRecognizer: UIPanGestureRecognizer)
Parameters
gestureRecognizer
The pan gesture responsible for the function call.