iOS Developer Library

Developer

UIKit Framework Reference UIPinchGestureRecognizer Class Reference

Options
Deployment Target:

On This Page
Language:

UIPinchGestureRecognizer

UIPinchGestureRecognizer is a concrete subclass of UIGestureRecognizer that looks for pinching gestures involving two touches. When the user moves the two fingers toward each other, the conventional meaning is zoom-out; when the user moves the two fingers away from each other, the conventional meaning is zoom-in. More...

Inheritance


Conforms To


Import Statement


import UIKit @import UIKit;

Availability


Available in iOS 3.2 and later.
  • scale scale Property

    The scale factor relative to the points of the two touches in screen coordinates.

    Declaration

    Swift

    var scale: CGFloat

    Objective-C

    @property(nonatomic) CGFloat scale

    Discussion

    You may set the scale factor, but doing so resets the velocity.

    The scale value is an absolute value that varies over time. It is not the delta value from the last time that the scale was reported. Apply the scale 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 pinch in scale factor 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.