Search code examples
iosuigesturerecognizerswipegesture-recognition

How to detect Swipe Gesture in iOS?


In my iPhone app, I require to recognize the swipe gesture made by the user on the view.

I want the swipe gestures to be recognized and perform a function on swipe.

I need that the view should horizontally slide and show another view as a user makes a swipe gesture.

What needs to be done?

How do I recognize it?


Solution

  • Use the UISwipeGestureRecognizer. Not much else to say really, gesture recognizers are easy. There are WWDC10 videos on the subject even. Sessions 120 and 121. :)