Class: UITouch
Overview
Instance Attribute Summary (collapse)
-
- gestureRecognizers
readonly
The gesture recognizers that are receiving the touch object.
-
- phase
readonly
The type of touch.
-
- tapCount
readonly
The number of times the finger was tapped for this given touch.
-
- timestamp
readonly
The time when the touch occurred or when it was last mutated.
-
- view
readonly
The view in which the touch initially occurred.
-
- window
readonly
The window in which the touch initially occurred.
Instance Method Summary (collapse)
-
- locationInView:
Returns the current location of the receiver in the coordinate system of the given view.
-
- previousLocationInView:
Returns the previous location of the receiver in the coordinate system of the given view.
Methods inherited from NSObject
#!, #!=, #!~, #, #==, #===, #=~, #Rational, #__callee__, #__method__, #__send__, #__type__, `, alloc, allocWithZone:, #autoContentAccessingProxy, autoload, autoload?, autorelease_pool, #awakeAfterUsingCoder:, binding, block_given?, caller, cancelPreviousPerformRequestsWithTarget:, cancelPreviousPerformRequestsWithTarget:selector:object:, catch, class, classFallbacksForKeyedArchiver, #classForCoder, #classForKeyedArchiver, classForKeyedUnarchiver, #clone, conformsToProtocol:, #copy, copyWithZone:, #dealloc, #define_singleton_method, description, display, #doesNotRecognizeSelector:, #dup, #enum_for, #eql?, #equal?, #extend, fail, #finalize, format, #forwardInvocation:, #forwardingTargetForSelector:, framework, #freeze, #frozen?, getpass, gets, global_variables, #init, initialize, #initialize_clone, #initialize_copy, #initialize_dup, #inspect, instanceMethodForSelector:, instanceMethodSignatureForSelector:, #instance_eval, #instance_exec, #instance_of?, #instance_variable_defined?, #instance_variable_get, #instance_variable_set, #instance_variables, instancesRespondToSelector:, isSubclassOfClass:, #is_a?, iterator?, #kind_of?, lambda, load, load_bridge_support_file, load_plist, local_variables, loop, #method, #methodForSelector:, #methodSignatureForSelector:, #methods, #mutableCopy, mutableCopyWithZone:, new, #nil?, open, p, #performSelector:onThread:withObject:waitUntilDone:, #performSelector:onThread:withObject:waitUntilDone:modes:, #performSelector:withObject:afterDelay:, #performSelector:withObject:afterDelay:inModes:, #performSelectorInBackground:withObject:, #performSelectorOnMainThread:withObject:waitUntilDone:, #performSelectorOnMainThread:withObject:waitUntilDone:modes:, print, printf, #private_methods, proc, #protected_methods, #public_method, #public_methods, #public_send, putc, puts, raise, rand, readline, readlines, #replacementObjectForCoder:, #replacementObjectForKeyedArchiver:, require, resolveClassMethod:, resolveInstanceMethod:, #respond_to?, #respond_to_missing?, select, #send, setVersion:, #singleton_methods, sprintf, srand, superclass, #taint, #tainted?, #tap, test, throw, #to_plist, #to_s, trace_var, trap, #trust, #untaint, untrace_var, #untrust, #untrusted?, version
Constructor Details
This class inherits a constructor from NSObject
Dynamic Method Handling
This class handles dynamic methods through the method_missing method in the class NSObject
Instance Attribute Details
- (Array) gestureRecognizers (readonly)
The gesture recognizers that are receiving the touch object. The objects in the array are instances of a subclass of the abstract base class UIGestureRecognizer. If there are no gesture recognizers currently receiving the touch objects, this property holds an empty array.
- (UITouchPhase) phase (readonly)
The type of touch. (read-only) The property value is a constant that indicates whether the touch began, moved, ended, or was canceled. For descriptions of possible UITouchPhase values, see “Touch Phase.”
- (Integer) tapCount (readonly)
The number of times the finger was tapped for this given touch. (read-only) The value of this property is an integer indicating the number of times the user tapped their fingers on a certain point within a predefined period. If you want to determine whether the user single-tapped, double-tapped, or even triple-tapped a particular view or window, you should evaluate the value returned by this method.
- (NSTimeInterval) timestamp (readonly)
The time when the touch occurred or when it was last mutated. (read-only) The value of this property is the time, in seconds, since system startup the touch either originated or was last changed. You can store and compare the initial value of this attribute to subsequent timestamp values of the UITouch instance to determine the duration of the touch and, if it is being swiped, the speed of movement. For a definition of the time-since-boot value, see the description of the systemUptime method of the NSProcessInfo class.
- (UIView) view (readonly)
The view in which the touch initially occurred. (read-only) The value of the property is the view object in which the touch originally occurred. This object might not be the view the touch is currently in.
- (UIWindow) window (readonly)
The window in which the touch initially occurred. (read-only) The value of the property is the window object in which the touch originally occurred. This object might not be the window the touch is currently in.
Instance Method Details
- (CGPoint) locationInView(view)
Returns the current location of the receiver in the coordinate system of the given view. This method returns the current location of a UITouch object in the coordinate system of the specified view. Because the touch object might have been forwarded to a view from another view, this method performs any necessary conversion of the touch location to the coordinate system of the specified view.
- (CGPoint) previousLocationInView(view)
Returns the previous location of the receiver in the coordinate system of the given view.