O'Reilly logo

iOS 9 SDK Development by Janie Clayton, Chris Adamson

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Gesture Recognizers

The first versions of the iPhone SDK gave us only low-level raw touch data via the UIView methods touchesBegan, touchesMoved, touchesEnded, and touchesCancelled. These delivered sets of UITouch events, and from the raw geometry and timing of these events, we could track events like swipes, using logic like “if the touch moved at least 50 points up, and not more than 20 points to either side, in less than 0.5 seconds, then treat it as an upward swipe.”

As one might expect, this was a huge pain in the butt to implement and led to variations in user experience as different developers interpreted the touch data differently, based on what “felt right” to them.

Fortunately, the situation was cleaned up in later versions of iOS ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required