iOS Developer Library

Developer

UIKit Framework Reference UIRotationGestureRecognizer Class

Options
Deployment Target:

On This Page
Language:

UIRotationGestureRecognizer

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. More...

Inheritance


Conforms To


Import Statement


import UIKit @import UIKit;

Availability


Available in iOS 3.2 and later.
  • rotation rotation Property

    The rotation of the gesture in radians.

    Declaration

    Swift

    var rotation: CGFloat

    Objective-C

    @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.

    Import Statement

    import UIKit

    Availability

    Available in iOS 3.2 and later.

  • velocity velocity Property

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

    Declaration

    Swift

    var velocity: CGFloat { get }

    Objective-C

    @property(nonatomic, readonly) CGFloat velocity

    Import Statement

    import UIKit

    Availability

    Available in iOS 3.2 and later.