jbehrens94
jbehrens94

Reputation: 2396

UIPageViewController: Swipe registration

I would like to achieve an animation when swiping from page to page on a UIPageViewController. I would like this animation to be linked to a UISwipeGestureRecognizer.

My question is: can I calculate a beginning and end of a swipe gesture and relatively execute an CGAffineTransform? So I during the swipe, I want to transform a view in the direction of the swipe.

Who has any good tutorials or snippets I could use?

Upvotes: 1

Views: 192

Answers (1)

Duncan C
Duncan C

Reputation: 131408

A couple of things.

Page view controllers are not built to use custom animations between pages. They are intended to use either a slide animation or a page curl animation.

Second, swipe gestures are single-shot, not continuous. There is no "relatively execute." When you do a swipe gesture, nothing happens, then the gesture fires and it's over. If you want an animation that's proportional to the user's finger position in the gesture you'll either need to do some specialized handling of a pan gesture recognizer or create your own custom gesture recognizer.

Upvotes: 2

Related Questions