07-19-2023, 12:49 AM
I am using a `UIPageViewController`, and I need to get the scroll position of the ViewController as the users swipe so I can partially fade some assets while the view is transitioning to the next `UIViewController`.
The delegate and datasource methods of `UIPageViewController` don't seem to provide any access to this, and internally I'm assuming that the `UIPageViewController` must be using a scroll view somewhere, but it doesn't seem to directly subclass it so I'm not able to call
func scrollViewDidScroll(scrollView: UIScrollView) {
}
I've seen some other posts suggestion to grab a reference to the `pageViewController!.view.subviews` and then the first index is a scrollView, but this seems *very* hacky. I'm wondering if there is a more standard way to handle this.
The delegate and datasource methods of `UIPageViewController` don't seem to provide any access to this, and internally I'm assuming that the `UIPageViewController` must be using a scroll view somewhere, but it doesn't seem to directly subclass it so I'm not able to call
func scrollViewDidScroll(scrollView: UIScrollView) {
}
I've seen some other posts suggestion to grab a reference to the `pageViewController!.view.subviews` and then the first index is a scrollView, but this seems *very* hacky. I'm wondering if there is a more standard way to handle this.