O'Reilly logo

iOS 8 SDK Development, 2nd Edition 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

Pinching and Panning

How can we play with images on iOS? The whole point of a touch interface is to provide the feeling of interacting directly with our data, so we should be thinking of moving the image around with a drag, zooming in and out of it with pinch gestures, and so forth.

Let’s take a look at what gesture recognizers give us. Here’s a table summarizing the concrete subclasses of UIGestureRecognizer and the important properties and/or methods exposed by each:

ClassImportant Properties and Methods

UILongPressGestureRecognizer

minimumPressDuration, allowableMovement

UIPanGestureRecognizer

translationInView:, velocityInView:

UIPinchGestureRecognizer

scale, velocity

UIRotationGestureRecognizer

rotation, velocity

UIScreenEdgePanGestureRecognizer ...

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