AppleTouch - UBogun/Xojo-iosLib GitHub Wiki

Inherits from AppleObject
Memory leak check: n/a.
Status: completed including iOS 9.1 features

This is an implementation of UITouch, a subclass of NSObject carrying information about a touch event. You receive UITouch objects in form of parameters of AppleController subclasses and usually don't create them on your own.

Constructor

no constructor: See above.

Properties

AltitudeAngle As Double (read-only): The altitude (in radians) of the stylus. Available since iOS 9.1.

AzimuthAngleIniInitialView As Double (read-only): A convenience method that calls AzimuthAngleInView on View. Available since iOS 9.1.

AzimuthUnitVectorInInitialView As FoundationFramework.CGVector (read-only): A convenience method that calls AzimuthUnitVectorInView on view. Available since iOS 9.1.

EstimatedProperties As AppleTouchProperty (read-only): A set of touch properties that will get updated. Available since iOS 9.1.

EstimatedPropertiesExpectingUpdates As AppleTouchProperty (read-only): A set of touch properties that expect to have incoming updates in the future. Available since iOS 9.1.

EstimationUpdateIndex As UInt64 (read-only): An index number that lets you correlate an updated touch with the original touch. Available since iOS 9.1.

Force As Double (read-only): The force of the touch, where a value of 1.0 represents the force of an average touch (predetermined by the system, not user-specific). Available since iOS 9.0.

GestureRecognizers As AppleArray of AppleGestureRecognizer (read-only): The gesture recognizers that are receiving the touch object.

LocationInInitialView As FoundationFramework.NSPoint (read-only): A convenience method that calls LocationInView on the view property of the instance.

MajorRadius As Double (read-only): The radius (in points) of the touch.

MajorRadiusTolerance As Double (read-only): The tolerance (in points) of the touch’s radius.

MaximumPossibleForce As Double (read-only): The maximum possible force for a touch. Available since iOS 9.0.

Phase As UITouchPhase (read-only): The phase of the touch.

TapCount As UInteger (read-only): The number of times the finger was tapped for this given touch.

Timestamp As Double (read-only): The time when the touch occurred or when it was last mutated. Reference is system startup time.

Type As UTouchType (read-only): The type of the touch.

View As AppleView (read-only): The view in which the touch initially occurred.

Window As AppleWindow (read-only): The window in which the touch initially occurred.

Methods

AzimuthAngleInView (view as AppleView) As Double: Returns the azimuth angle (in radians) of the stylus. Available since iOS 9.1.

AzimuthUnitVectorInView (View As AppleView) As FoundationFramework.CGVector: Returns a unit vector that points in the direction of the azimuth of the stylus. Availabe since iOS 9.1.

LocationInView (View As AppleView) As FoundationFramework.NSPoint: Returns the current location of the receiver (the touch) in the coordinate system of the given view.

PreciseLocationInView (View As AppleView) As FoundationFramework.NSPoint: Returns a precise location for the touch, when available. Available since iOS 9.1.

PrecisePreviousLocationInView (View As AppleView) As FoundationFramework.NSPoint: Returns a precise previous location for the touch, when available. Available since iOS 9.1.

PreviousLocationInView (View As AppleView) As FoundationFramework.NSPoint: Returns the previous location of the receiver in the coordinate system of the given view.

Enumerations

UITouchPhase

Value Definition
Began The touch just started.
Moved The location of the touch has moved.
Stationary The Touch location has not moved.
Ended The touch has ended.
Cancelled The touch was cancelled, perhaps by a low memory or other system event.

UITouchType

Value Definition
Direct A direct touch with a finger on the screen
Indirect An indirect touch, not on a screen.
Stylus A Touch with a stylus on screen.

More information see Constants

Helper class

AppleTouchProperties

AppleTouchProperties is another integer wrapper with a bitmap mask that is used to inform about estimated touch property changes. It contains the binary properties:
Altitude
Azimuth
Force
Location