A friend of mine recently asked how many simultaneous touch events the iPad supported; I wasn’t sure, so I promised to write some code to conduct an experiment and find the answer. I got around to doing so, and the answer is: eleven.
I’m sure you can imagine the response from certain colleagues regarding that number (not just “this one goes up to eleven”, but also “ten fingers and a…”, well, quite.) I thought you might want to see it in action, or play with it yourself. There’s a screenshot below:
You can also see a video on YouTube, which is embedded below. Please note that the videos show only ten touches, but I previously established (with Lauren’s help) that the iPad supports exactly 11. You can reproduce the result yourself using ten fingers and the pads of your thumbs, or lowest knuckle-joints of your index fingers, or your nose and chin (or just ask a friend, which will look less odd).
And here’s a video showing the new touch animations. It’s just not sci-fi until you have Spinning Arrows From Space:
And finally, of course, you can get the source code from my subversion repository (requires iPhone SDK 3.2, etc – if you don’t know how to get code from a subversion repository, see the note at the end of this post). Trivial but fun!
I’ll hopefully be posting a few more experiments in coming weeks/months, so feel free to follow me on Twitter to stay up to date. I will also whorishly link you to my Amazon wishlist if you’re feeling grateful.
(Footnote: We went to see Iron Man 2 the other night, and the touch-tracking appearance was definitely loosely inspired by all of Tony Stark’s nifty holographic computer UI toys.)
How to get code from the Subversion repository
Just launch the Terminal application (it’s in /Applications/Utilities), paste the following command into the window (all on one line) and then press Return:
svn checkout http://svn.cocoasourcecode.com/TouchTest ~/Desktop/TouchTest
That command will checkout the latest copy of the source into a folder on your Desktop called “TouchTest”. The actual name of the folder is up to you, and you can then move that folder anywhere you like.
Whenever you want to update to the latest version of the code thereafter, launch the Terminal application again and use the commands below. Note that there are two commands, and that they should be pasted into Terminal one at a time, pressing Return after each. Also note that you should obviously change the first command to use the actual path to wherever you’re keeping the code.
cd ~/Desktop/TouchTest svn update
If you want to learn more about Subversion, you can read the free online Subversion book.
You can also just add the repository to Xcode’s Repositories window!