Events and Touch
iOS Developer Tips - Visitor Stats:
|
|
|
Gestures Recognizers – Tap, Pinch/Zoom, Rotate, Swipe, Pan, Long Press
The UIGestureRecognizer class is available to help with detecting and responding to the various UI gestures common on iOS devices. UIGestureRecognizer is an abstract class, with the following concrete subclasses, one for each type of available recognizer: UITapGestureRecognizer UIPinchGestureRecognizer UIRotationGestureRecognizer UISwipeGestureRecognizer UIPanGestureRecognizer UILongPressGestureRecognizer
Encapsulating Begin Ignoring Events and End Ignoring Events
There are times when it’s really handy to stop event processing momentarily so you can perform an update to the UI (e.g. sliding a custom view into place using a timed animation) or you otherwise need to save the user from themselves by momentarily stopping touch events. I’ve written previously on How to Suspend / [...]
How Long was a Touch Event – Detecting When a Touch Event Starts and Ends
Here’s a quick tip that shows how to determine the length of time from a begin touch event to an end touch event. I used a similar snippet of code recently when I had to determine if a user tapped on an image or held their finger on the image for a pre-determined amount of [...]
Suspend or Ignore Touch Events
Temporarily stop/suspend touch events on the iPhone.
Where Was Touch – Determine if Touch/Point is Within Rectangle
I recently had to write a short chunk of code to determine when a user touches a specific rectangular region on the screen. Detecting this is nothing more than getting a reference to a CGPoint (x and y coordinates) of the location touched and checking to see if the point is within the rectangular bounds [...]






