GLGestureRecognizer is a Objective-C implementation of the $1 Unistroke Recognizer, a simple gesture recognition algorithm. It was implemented over the course of a couple evenings in late April 2009 by Adam Preble.

GLGestureRecognizer is available on github: GLGestureRecognizer

The screenshot at left shows the demo running in the iPhone Simulator; a UIView subclass receives touch events and sends them to the GLGestureRecognizer class while drawing the touched path in white. Once the gesture is completed, the resampled gesture is shown in green, its center at the red dot, along with the name of the best match, score (lower is better), and gesture orientation. A sample size of 16 points is used in the example, which seems to be adequate for very basic shapes.

Release Notes

April 28, 2009
  • Initial public release.


I am making GLGestureRecognizer available as open source, with the only requirement of using it being that you e-mail me and let me know what you're using it in.


Adam Preble:


You may be interested to see our iPhone games, Slingshot and Shufflepuck, neither of which use gesture recognition.