0

I need to navigate to another view controller when swipe (left, right, up, down). And the other view controller should change according to the user finger movement, not to change view controller with in given time. I used

UIView.animateWithDuration(0.9, animations: { () -> Void in

but it used a duration, so does not change according to user movement.

Eric Aya
  • 69,473
  • 35
  • 181
  • 253
Mudith Chathuranga Silva
  • 7,253
  • 2
  • 50
  • 58

1 Answers1

1

UISwipeGestureRecognizer is not the proper gesture recognizer you should use here. If you want to change the content when user is doing some gestures (movements), you have to use UIPanGestureRecognizer. With pan gesture recognizer, you can track the position of the gesture in the view, and change the view accordingly.

Fahri Azimov
  • 11,470
  • 2
  • 21
  • 29