2009
5/10

iPhone Touch Sample Code







6Tringle's featured product: PhotoClay Logo Photo mushing fun with your finger

Buy app through iTunes








We enthusiastically recommend:

The iPhone SDK's UIKit allows extremely versatile touch event handling. With only four methods, Apple has exposed nearly limitless potential for programatic reaction. The problem is that these four methods are essentially exposing the hardware. To do anything interesting or useful, one must wrap meat around these bones. Apple's Event Handling documentation covers several simple cases of touch handling:

  1. single, double, triple tap etc.
  2. swipes
  3. location sensitive combo touches, simply described as a "Complex Multi-Touch Sequence", this is merely doing hit-testing on the touches.

Curiously, clear examples for certain basic interactions such as tap-and-hold or pinch-to-zoom are missing.

I'd like to rectify that. This recent inclination is compounded by my new-found passion for the au courant open source repository Github. This illicit dyad has produced the creatively named TouchSampleCode.

Currently, I've coded examples for the following cases (along with the implicit intention to add more):

  • Tap and Hold
  • Tap and Hold with delay
  • DoubleTap and Hold
  • Multi-touch (two fingers) with simple stretch and pinch for zoom and unzoom

The iPhones lack of a keyboard doesn't mean it's not a rich environment for human interaction. The current limitation is not in the hardware, but in the creatively of the developers. Future postings will explore some conjectures on creative uses of the interface.

Please consider leaving a tip if you find this useful. These kinds of small tokens are great energizers and tend to encourage more content.

Products of unassailable virtue and rectitude

about products blog contact misc xml