UIRotationGestureRecognizer Class

Inherits from
Conforms to
Framework
/System/Library/Frameworks/UIKit.framework
Availability
Available in iOS 3.2 and later.
Companion guide
Declared in
UIRotationGestureRecognizer.h
Related sample code

Overview

UIRotationGestureRecognizer is a concrete subclass of UIGestureRecognizer that looks for rotation gestures involving two touches. When the user moves the fingers opposite each other in a circular motion, the underlying view should rotate in a corresponding direction and speed.

Rotation is a continuous gesture. It begins when two touches have moved enough to be considered a rotation. The gesture changes when a finger moves while the two fingers are down. It ends when both fingers have lifted. At each stage in the gesture, the gesture recognizer sends its action message.

Tasks

Interpreting the Gesture

Properties

rotation

The rotation of the gesture in radians.

@property(nonatomic) CGFloat rotation
Discussion

You may set the rotation value to an arbitrary value; however, setting the rotation resets the velocity.

The rotation value is a single value that varies over time. It is not the delta value from the last time that the rotation was reported. Apply the rotation value to the state of the view when the gesture is first recognized—do not concatenate the value each time the handler is called.

Availability
  • Available in iOS 3.2 and later.
Declared In
UIRotationGestureRecognizer.h

velocity

The velocity of the rotation gesture in radians per second. (read-only)

@property(nonatomic, readonly) CGFloat velocity
Availability
  • Available in iOS 3.2 and later.
Declared In
UIRotationGestureRecognizer.h