Protocol: UIPageViewControllerDelegate

Overview

The delegate of a page view controller must adopt the UIPageViewControllerDelegate protocol. These methods allow the delegate to receive a notification when the device orientation changes and when the user navigates to a new page. For page-curl style transitions, the delegate can provide a different spine location in response to a change in the interface orientation.Called after a gesture-driven transition completes.Returns the spine location for the given orientation.Called before a gesture-driven transition begins. (required)

Instance Method Summary (collapse)

Instance Method Details

- (Object) pageViewController(pageViewController, didFinishAnimating:finished, previousViewControllers:previousViewControllers, transitionCompleted:completed)

Called after a gesture-driven transition completes. 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.

Parameters:

  • pageViewController (UIPageViewController)

    The page view controller.

  • finished (Boolean)

    YES if the animation finished; otherwise, NO.

  • previousViewControllers (Array)

    The view controllers prior to the transition.

  • completed (Boolean)

    YES if the user completed the page-turn gesture; otherwise, NO.

Returns:

- (UIPageViewControllerSpineLocation) pageViewController(pageViewController, spineLocationForInterfaceOrientation:orientation)

Returns the spine location for the given orientation. Use this method to change the spine location when the device orientation changes, as well as setting new view controllers and changing the double-sided state.This method is called only if the transition style is UIPageViewControllerTransitionStylePageCurl.

Parameters:

Returns:

  • (UIPageViewControllerSpineLocation)

    The spine location.

- (Object) pageViewController(pageViewController, willTransitionToViewControllers:pendingViewControllers)

Called before a gesture-driven transition begins. (required) If the user aborts the navigation gesture, the transition doesn’t complete and the view controllers stay the same.

Parameters:

  • pageViewController (UIPageViewController)

    The page view controller.

  • pendingViewControllers (Array)

    The view controllers that are being transitioned to.

Returns: