My main controller has a UIPageViewController. I want to swipe across differently structured views, so I can't use the same controller. Also, I don't want to pollute the main storyboard. I want to have different XIB files with custom controllers. So far so good.
I want to be able to provide the index to the UIPageViewController.
This answer shows how to do it with multiple view controllers but they are all within the storyboard.
I have tried the same approach. I created my XIBs with corresponding ViewControllers. In order to provide the index to the PageViewController, I tried setting the RestorationId to the view to access later in the code. In the PageViewController, I build the controller like this:
func viewControllerAtIndex(index: Int) -> UIViewController {
let vc = UIViewController(nibName: controllersNames[index], bundle: nil)
...
}
But if I do
vc.restorationIdentifier
I get nil..
So I can't seem to find a way to bind the controller to the index I need to provide the UIPageViewController.
Please help.