In the IOS developer library, instructions say:
To directly control what content is being displayed, call the
setViewControllers:direction:animated:completion:method
And that’s what I’m trying to do, without success.
Here’s what I’ve tried in my RootViewController.m:
NSLog(@"%s", __FUNCTION__ );
[self.pageViewController setViewControllers:
[NSArray arrayWithObjects:
[self.storyboard instantiateViewControllerWithIdentifier:
@"AlbumPageViewController4"],nil]
direction:UIPageViewControllerNavigationDirectionForward
animated:YES completion:nil];
I know the AlbumPageViewController.m button is calling it as it displays in the NSLog. But nothing happens, no crash, no errors, no page curls. My spine location is UIPageViewControllerSpineLocationMin so I think I only need to pass it 1 view controller.
I have tried 2, but that doesn’t work either.
How can I have a button that allows me to “let the user jump to a specific location in the content” just like the Docs say?
Calling a function in the RootViewController from a different class directly doesn’t work. All of the self.anything are all nil.
After setting up some delegation and having the RootViewController listen and respond to the other class, the code works just fine.