Instance Method

pageViewController(_:didFinishAnimating:previousViewControllers:transitionCompleted:)

Called after a gesture-driven transition completes.

Declaration

optional func pageViewController(_ pageViewController: UIPageViewController, didFinishAnimating finished: Bool, previousViewControllers: [UIViewController], transitionCompleted completed: Bool)

Parameters

pageViewController

The page view controller.

finished

true if the animation finished; otherwise, false.

previousViewControllers

The view controllers prior to the transition.

completed

true if the user completed the page-turn gesture; otherwise, false.

Discussion

Use the completed parameter to distinguish between a transition that completed (the page was turned) and a transition that the user aborted (the page was not turned).

The value of the previousViewControllers parameter is the same as what the viewControllers method would have returned prior to the page turn.

See Also

Responding to Page View Controller Events