iOS Developer Library

Developer

UIKit Framework Reference UILongPressGestureRecognizer Class Reference

Options
Deployment Target:

On This Page
Language:

UILongPressGestureRecognizer

UILongPressGestureRecognizer is a concrete subclass of UIGestureRecognizer that looks for long-press gestures. The user must press one or more fingers on a view and hold them there for a minimum period of time before the action triggers. While down, the user’s fingers may not move more than a specified distance; if they move beyond the specified distance, the gesture fails. More...

Inheritance


Conforms To


Import Statement


import UIKit @import UIKit;

Availability


Available in iOS 3.2 and later.
  • The minimum period fingers must press on the view for the gesture to be recognized.

    Declaration

    Swift

    var minimumPressDuration: CFTimeInterval

    Objective-C

    @property(nonatomic) CFTimeInterval minimumPressDuration

    Discussion

    The time interval is in seconds. The default duration is is 0.5 seconds.

    Import Statement

    import UIKit

    Availability

    Available in iOS 3.2 and later.

  • The number of fingers that must be pressed on the view for the gesture to be recognized.

    Declaration

    Swift

    var numberOfTouchesRequired: Int

    Objective-C

    @property(nonatomic) NSUInteger numberOfTouchesRequired

    Discussion

    The default number of fingers is 1.

    Import Statement

    import UIKit

    Availability

    Available in iOS 3.2 and later.

  • The number of taps on the view required for the gesture to be recognized.

    Declaration

    Swift

    var numberOfTapsRequired: Int

    Objective-C

    @property(nonatomic) NSUInteger numberOfTapsRequired

    Discussion

    The default number of taps is 0.

    Import Statement

    import UIKit

    Availability

    Available in iOS 3.2 and later.

  • The maximum movement of the fingers on the view before the gesture fails.

    Declaration

    Swift

    var allowableMovement: CGFloat

    Objective-C

    @property(nonatomic) CGFloat allowableMovement

    Discussion

    The allowable distance, measured in points. The default distance is 10 points.

    Import Statement

    import UIKit

    Availability

    Available in iOS 3.2 and later.