iOS Guides | Samples

UIKit.UITouch Class

Represents a touch event on the screen.

See Also: UITouch


[Foundation.Register("UITouch", true)]
public class UITouch : NSObject


This object encapsulates a touch or a finger movement on the screen.

The UITouch event is typically available from the NSSet passed to the Touch methods and also from the UIEvent instance that is passed to those methods.

UIViews by default only handle a single touch event at once. If you want your view to handle multiple touches, you must set the UIView.MultipleTouchEnabled to true.

iOS creates a T:UIKit.UIEvent object any time a finger touches the screen, moves or is removed from the screen. The UIEvent encapsulates all of the touches that are taking place on the screen at this point, even those that do not belong to this view. In addition to the UIEvent, there is an NSSet containing UITouch objects that represent the state of each finger on the screen for this particular view.

Related content


Namespace: UIKit
Assembly: Xamarin.iOS (in Xamarin.iOS.dll)
Assembly Versions:

The members of UIKit.UITouch are listed below.

See Also: NSObject

Public Constructors

Default constructor that initializes a new instance of this class with no parameters.

Protected Constructors

Constructor to call on derived classes to skip initialization and merely allocate the object.
A constructor used when creating managed representations of unmanaged objects; Called by the runtime.

Public Properties

AltitudeAnglenfloat. The altitude, in radians, above horizontal, of the stylus.
ClassHandleIntPtr. The handle for this class.
EstimatedPropertiesUITouchProperties. The set of properties that may vary over the course of a touch.
EstimatedPropertiesExpectingUpdatesUITouchProperties. The set of properties that are likely to vary over the course of a touch.
EstimationUpdateIndexNSNumber. If not null, a monotonically-increasing index into UITouch objects that have UITouch.EstimatedProperties.
Forcenfloat. Gets the force of the touch, where 1.0 represents the system-defined average force.
GestureRecognizersUIGestureRecognizer[]. The UIGestureRecognizers that are receiving this UITouch.
MajorRadiusnfloat. The radius of the touch, governed by the UITouch.MajorRadiusTolerance setting.
MajorRadiusTolerancenfloat. Provides the tolerance for the MajorRadius property.   The actual radius is measured by MajorRadius±MajorRadiusTolerance.
MaximumPossibleForcenfloat. Gets the maximum force value that the system will recognize.
PhaseUITouchPhase. The UITouchPhase of this UITouch.
TapCountnint. The number of taps associated with this UITouch. Read-only.
TimestampDouble. The time when this UITouch was created or last mutated. Read-only.
TypeUITouchType. The UITouchType of the UITouch.
ViewUIView. The UIView in which this UITouch occurred. Read-only.
WindowUIWindow. The UIWindow in which this UITouch occurred. Read-only.

Public Methods

GetAzimuthAngle(UIView) : nfloat
Returns the rotation of the stylus relative to the plane of the screen, in radians.
GetAzimuthUnitVector(UIView) : CGVector
Returns the rotation of the pointing device relative to the plane of the screen, as a unit vector.
GetPreciseLocation(UIView) : CGPoint
Returns a precise location for the UITouch.
GetPrecisePreviousLocation(UIView) : CGPoint
Returns the UITouch object's previous precise location.
LocationInView(UIView) : CGPoint
The location of this UITouch, in the coordinate system of the specified UIView.
PreviousLocationInView(UIView) : CGPoint
The previous location of this UITouch, in the coordinate system of the specified UIView.