SwipeViewController icon indicating copy to clipboard operation
SwipeViewController copied to clipboard

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

Open casey55 opened this issue 7 years ago • 4 comments

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

casey55 avatar Jul 17 '18 19:07 casey55

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

fortmarek avatar Jul 18 '18 09:07 fortmarek

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.

casey55 avatar Jul 18 '18 12:07 casey55

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.

fortmarek avatar Jul 19 '18 08:07 fortmarek

Will do. Thanks!

casey55 avatar Jul 19 '18 12:07 casey55