Get Updates By E-mail 

Article Written By:
Johann Dowa

Open Source: Easy Multistroke and Single Stroke Complex Gesture Recognition On iOS

  •  
  •  
  •  
  •  
  •  

If you’ve ever wondered how to code gesture recognition for complex shapes I’ve come across a couple of open source libraries that should be a great deal of help.  This goes well beyond finger swiping.

This library is based on the $1 gesture recognizer which I remember being discussed quite a bit a few years back because not only did it run efficiently,  but allowed you define the templates to recognize complex shapes very easily.   The $1 gesture recognizer only recognizes 1 single stroke from the user.  The $1 gesture recognizer was later expanded on to become the $N multistroke gesture recognizer.

Brit Gardner has taken the $N gesture recognizer and created an Objective-C implementation of the code.

You can read about complex gesture recognition, and why Brit decided to use the $N gesture recognizer on his site in these posts:

Complex Gesture Recognition in iOS – Part 1: The Research
Complex Gesture Recognition in iOS – Part 2: The Implementation

You can find Brit’s Github for the Objective-C $N gesture recognizer here:

https://github.com/britg/MultistrokeGestureRecognizer-iOS

Adam Preble has created an implementation of the $1 gesture recognizer which can be found here:

https://github.com/preble/GLGestureRecognizer

You can try out the javascript versions, check out the full pseudocode, or download other versions of the gesture recognizers from the University of Washington here:

The $1 Gesture Recognizer
The $N Multistroke Gesture Recognizer

I’ve received e-mails a couple of times over the years asking about how some drawing games were created on the iPhone.  If you are looking to make that kind of game this should help give you a head start.


  •  
  •  
  •  
  •  
  •  

Submit A Resource

Have you created a useful tutorial, library or tool for iOS development that you would like to get in front of our 300,000+ monthly page views from iOS developers?

You can submit the url here.

The resources we feel will appeal to our readers the most will be posted on the front page.

Comments