Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Using UIPageViewController in storyboards

Is there a way to configure datasource, delegate and view controllers for UIPageViewController in storyboard without writing a code? I do see outlets for datasource and delegate in UIPageViewController, but there is no way to do connections between scenes, and no way to add additional controller into the same scene.

What is the purpose to have UIPageViewController in Interface Builder if it is not configurable at all with IB?

like image 770
Nikita Leonov Avatar asked Oct 21 '22 13:10

Nikita Leonov


1 Answers

It is fully configurable in Xcode. You'll connect the data-source and delegate outlets to classes that inherit the appropriate protocols (UIPageViewControllerDataSource and UIPageViewControllerDelegate).

But, you must do some implementation for the two protocols - usually by accessing your model's data. It is common, but not required, to have the controller for the UIPageView be handle these two protocols. As:

@interface MyPageViewController : UIPageViewController
  <UITableViewDataSource,  UITTableViewDelegate>
...
@end
like image 188
GoZoner Avatar answered Oct 31 '22 18:10

GoZoner