I'm using a UIPageViewController to swipe through a series of viewcontrollers. I'd like the background of the parent viewcontroller to smoothly transition between colors when swiping, based on the position of the scroll between views. I was hoping UIPageViewController would have a delegate method similar to scrollViewDidScroll with the position, but it doesn't seem to.
Is there an alternate method or similar method to expose the position of the swipe as it occurs/changes?
EDIT: Since scrollview seems not to be exposed, I've come up with a perm/temp solution. When transitioning between pages I transition the parent background color over an Animation of 1 second. This does not directly tie to the swipe, or allow for half swipes, etc. But for regular side to side swipes it accomplishes the desired smooth effect instead of instant color change.
// code that occurs when a pageControl swipe occurs.
UIColor *destinationColor = [UIColor redColor]; // the desired end color
[UIView animateWithDuration:1.0
delay:0
options:UIViewAnimationOptionAllowUserInteraction
animations:^{
self.pageViewController.view.backgroundColor = destinationColor;
}
completion:nil
];