Tell When a UIPageViewController is Scrolling (for Parallax Scrolling of an Image)

for (UIView *view in self.pageViewController.view.subviews) { if ([view isKindOfClass:[UIScrollView class]]) { [(UIScrollView *)view setDelegate:self]; } } this gives you access to all standard scroll view API methods. And this is not using private Apple API’s. I added traversing through subviews, to 100% find the UIPageViewController‘s inner scroll view WARNING: Be careful with scrollview.contentOffset. It resets … Read more

How to implement UIPageViewController that utilizes multiple ViewControllers

First of all, you are absolutely right that the view controllers that constitute the “pages” of the UIPageViewController can be completely different in nature. Nothing whatever says that they have to be instances of the same view controller class. Now let’s get to the actual problem, which is that you very sensibly need a way … Read more

Increase the size of the indicator in UIPageViewController’s UIPageControl

Scaling the page control will scale the dots, but will also scale the spacing in between them. pageControl.transform = CGAffineTransform(scaleX: 2, y: 2) If you want to keep the same spacing between dots, you’ll need to transform the dots individually: pageControl.subviews.forEach { $0.transform = CGAffineTransform(scaleX: 2, y: 2) } However, if you do this in … Read more

PageViewController current page index in Swift

You can use didFinishAnimating, and set tags to viewcontrollers. try this func pageViewController(pageViewController: UIPageViewController, didFinishAnimating finished: Bool, previousViewControllers: [UIViewController], transitionCompleted completed: Bool) { if (!completed) { return } self.pageControl.currentPageIndex = pageViewController.viewControllers!.first!.view.tag //Page Index }

Refresh UIPageViewController – reorder pages and add new pages

I found a workaround to force UIPageViewController to forget about cached view controllers of neighboring pages that are currently not displayed: pageViewController.dataSource = nil; pageViewController.dataSource = self; I do this everytime I change the set of pages. Of course this doesn’t affect the currently displayed page. With this workaround I avoid the caching bug and … Read more

How do I make the bottom bar with dots of a UIPageViewController translucent?

It is very easy to make it work. You just only have to make the pageviewcontroller taller, and place a PageControl into the XIB file. The trick is put the PageControl in the foreground (and all the other common controls) at the beginning, and update the content of the PageControl with the PageViewController. Here is … Read more

tech