0

I want to add multiple view controller in a page controller so that view controller can scroll left and right side in page view controller.

How to do like this..?

Suraj Sukale
  • 1,778
  • 1
  • 12
  • 19
Ashok
  • 5
  • 4

1 Answers1

0

You need to implement the UIPageViewControllerDataSource. All the documentation is found here:

https://developer.apple.com/library/ios/documentation/UIKit/Reference/UIPageViewControllerDataSourceProtocolRef/index.html

In the

pageViewController:viewControllerBeforeViewController:
pageViewController:viewControllerAfterViewController:

methods you return the UIViewControllers you want to show.

With the

setViewControllers:direction:animated:completion:

method from the UIPageViewController you can set the initial UIViewController.

Jan Doornbos
  • 639
  • 6
  • 25
  • Jan thanks for the details,Do you have a sample code, if yes please share with me.I have tried using delegate methods but its not working for me. – Ashok Jun 29 '16 at 11:42
  • There are enough tutorials online. Like the one Suraj Sukale recommended you: http://www.appcoda.com/uipageviewcontroller-storyboard-tutorial/ – Jan Doornbos Jun 29 '16 at 13:02