iOS Guides | Samples

UIKit.UITouch Class

Represents a touch event on the screen.

See Also: UITouch

Syntax

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

Remarks

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

Requirements

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

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

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