fortmarek / SwipeViewController

SwipeViewController is a Swift modification of RKSwipeBetweenViewControllers - navigate between pages / ViewControllers
MIT License
655 stars 46 forks source link

Is there a way to programmatically switch to next or previous page? #33

Open casey55 opened 6 years ago

casey55 commented 6 years ago

Is there a way to programmatically switch to next or previous page?

fortmarek commented 6 years ago

SwipeViewController is a subclass of UIPageViewController, so it should work the same. Let me know how it goes.

casey55 commented 6 years ago

Wanted to try that be doing something like the following, but don't have access to the underlying "pageController"

pageController.setViewControllers([myViewController], direction: .forward, animated: true, completion: nil) I thought SwipeViewController was subclass of UINavigationController that contains a UIPageViewController and access to the underlying "pageController" is not allowed.

fortmarek commented 6 years ago

You're right, I'm on a vacation now, so I'd suggest to either just open the underlying pageController, and I'll later look into it, or, which I would obviously prefer, create a PR where you would create a function to turn to the next page programmatically while keeping the pageController internal to the SwipeViewController.

casey55 commented 6 years ago

Will do. Thanks!