Instance Property

numberOfTouches

Returns the number of touches involved in the gesture represented by the receiver.

Declaration

var numberOfTouches: Int { get }

Return Value

The number of UITouch objects in a private array maintained by the receiver. Each of these objects represents a touch in the current gesture.

Discussion

Using the value returned by this method in a loop, you can ask for the location of individual touches using the location(ofTouch:in:) method.

See Also

Getting the Touches and Location of a Gesture

func location(in: UIView?) -> CGPoint

Returns the point computed as the location in a given view of the gesture represented by the receiver.

func location(ofTouch: Int, in: UIView?) -> CGPoint

Returns the location of one of the gesture’s touches in the local coordinate system of a given view.