EMPageViewControllerDataSource

@objc public protocol EMPageViewControllerDataSource

The EMPageViewControllerDataSource protocol is adopted to provide the view controllers that are displayed when the user scrolls through pages. Methods are called on an as-needed basis.

Each method returns a UIViewController object or nil if there are no view controllers to be displayed.

Note

If the data source is nil, gesture based scrolling will be disabled and all view controllers must be provided through selectViewController:direction:animated:completion:.
  • Called to optionally return a view controller that is to the left of a given view controller in a horizontal orientation, or above a given view controller in a vertical orientation.

    Declaration

    Swift

    func em_pageViewController(_ pageViewController: EMPageViewController, viewControllerBeforeViewController viewController: UIViewController) -> UIViewController?

    Parameters

    pageViewController

    The page view controller

    viewController

    The point of reference view controller

    Return Value

    The view controller that is to the left of the given viewController in a horizontal orientation, or above the given viewController in a vertical orientation, or nil if there is no view controller to be displayed.

  • Called to optionally return a view controller that is to the right of a given view controller.

    Declaration

    Swift

    func em_pageViewController(_ pageViewController: EMPageViewController, viewControllerAfterViewController viewController: UIViewController) -> UIViewController?

    Parameters

    pageViewController

    The page view controller

    viewController

    The point of reference view controller

    Return Value

    The view controller that is to the right of the given viewController in a horizontal orientation, or below the given viewController in a vertical orientation, or nil if there is no view controller to be displayed.