Class

UIPageViewController

A page view controller lets the user navigate between pages of content, where each page is managed by its own view controller object. Navigation can be controlled programmatically by your app or directly by the user using gestures. When navigating from page to page, the page view controller uses the transition that you specify to animate the change.

Overview

When defining a page view controller interface, you can provide the content view controllers one at a time (or two at a time, depending upon the spine position and double-sided state) or as-needed using a data source. When providing content view controllers one at a time, you use the setViewControllers(_:direction:animated:completion:) method to set the current content view controllers. To support gesture-based navigation, you must provide your view controllers using a data source object.

The data source for a page view controller is responsible for providing the content view controllers on demand and must conform to the UIPageViewControllerDataSource protocol. The delegate object—an object that conforms to the UIPageViewControllerDelegate protocol—provides some appearance-related information and receives notifications about gesture-initiated transitions.

This class is generally used as-is but may be subclassed in iOS 6 and later.

Symbols

Providing Content

var viewControllers: [UIViewController]?

The view controllers displayed by the page view controller.

var gestureRecognizers: [UIGestureRecognizer]

An array of UIGestureRecognizer objects that are configured to handle user interaction.

Display Options

var transitionStyle: UIPageViewControllerTransitionStyle

The style used to transition between view controllers.

var isDoubleSided: Bool

A Boolean value that indicates whether content appears on the back of pages.

Constants

UIPageViewControllerNavigationOrientation

Orientations for page-turn transitions.

UIPageViewControllerNavigationDirection

Directions for page-turn transitions.

UIPageViewControllerTransitionStyle

Styles for the page-turn transition.

Options Keys

Keys for the options dictionary.

UIPageViewControllerSpineLocation

Locations for the spine.