UIPageViewControllerDelegate Protocol Reference

Conforms to
Framework
/System/Library/Frameworks/UIKit.framework
Availability
Available in iOS 5.0 and later.
Companion guide
Declared in
UIPageViewController.h

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.

Tasks

Responding to Page View Controller Events

Overriding View Rotation Settings

Instance Methods

pageViewController:didFinishAnimating:previousViewControllers:transitionCompleted:

Called after a gesture-driven transition completes.

- (void)pageViewController:(UIPageViewController *)pageViewController didFinishAnimating:(BOOL)finished previousViewControllers:(NSArray *)previousViewControllers transitionCompleted:(BOOL)completed
Parameters
pageViewController

The page view controller.

finished

YES if the animation finished; otherwise, NO.

previousViewControllers

The view controllers prior to the transition.

completed

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

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.

Availability
  • Available in iOS 5.0 and later.
Declared In
UIPageViewController.h

pageViewController:spineLocationForInterfaceOrientation:

Returns the spine location for the given orientation.

- (UIPageViewControllerSpineLocation)pageViewController:(UIPageViewController *)pageViewController spineLocationForInterfaceOrientation:(UIInterfaceOrientation)orientation
Parameters
pageViewController

The page view controller

orientation

The new orientation.

Return Value

The spine location.

Discussion

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.

Availability
  • Available in iOS 5.0 and later.
Declared In
UIPageViewController.h

pageViewController:willTransitionToViewControllers:

Called before a gesture-driven transition begins.

- (void)pageViewController:(UIPageViewController *)pageViewController willTransitionToViewControllers:(NSArray *)pendingViewControllers
Parameters
pageViewController

The page view controller.

pendingViewControllers

The view controllers that are being transitioned to.

Discussion

If the user aborts the navigation gesture, the transition doesn’t complete and the view controllers stay the same.

Availability
  • Available in iOS 6.0 and later.
Declared In
UIPageViewController.h

pageViewControllerPreferredInterfaceOrientationForPresentation:

Returns the preferred orientation for presentation of the page view controller, as determined by the delegate.

- (UIInterfaceOrientation)pageViewControllerPreferredInterfaceOrientationForPresentation:(UIPageViewController *)pageViewController;
Parameters
pageViewController

The page view controller.

Return Value

The preferred orientation for presenting the page view controller.

Availability
  • Available in iOS 7.0 and later.
Declared In
UIPageViewController.h

pageViewControllerSupportedInterfaceOrientations:

Returns the complete set of supported interface orientations for the page view controller, as determined by the delegate.

- (NSUInteger)pageViewControllerSupportedInterfaceOrientations:(UIPageViewController *)pageViewController;
Parameters
pageViewController

The page view controller.

Return Value

One of the UIInterfaceOrientationMask constants that represents the set of interface orientations supported by the page view controller.

Availability
  • Available in iOS 7.0 and later.
Declared In
UIPageViewController.h