Tip Details Add a Related Tip

Rate as: Positive Negative

Handling multiple fingers swipes on the iPhone

If you are doing development for the iPhone or iPod Touch and your application needs to handle swipe gestures, you may run into an issues when the user uses multiple fingers on the swipe. The iPhone SDK does not give you a way to reliably know which Touch event (UITouch) corresponds to which finger. So when you get a callback that movement has occurred and there are multiple UITouch elements in the event, they get jumbled between calls. So sometimes the first UITouch object is the first finger, sometimes it's the second. If you are trying to have your swipe be relative to the original touch location, this makes it really hard to get an accurate reading of how far they have swiped.

There's an easy way to fix this. But it only works if you application does not need to handle multi-finger gestures, like pinches. And that is to just turn off handling of multiple touches in the view. If you do this, you'll always just have one UITouch event and it will always correspond to the same finger.

To do this open the Interface Builder and select the View in which the touches are happening. Then just uncheck the box next to "Multiple Touch" (as seen here):

Turning off multiple touch support on the iPhone Turning off multiple touch support on the iPhone

Once you uncheck this box (which is checked by default), handling swipes will be a lot easier in your code.
Rating: 100% positive, 1 Vote
Categories: iPhone iPod Touch development apple Xcode
Added: on May 14, 2009 at 2:05 pm
Added By: an anonymous user
Searches: touch iphone multiple swipe finger

Comments on this Tip

Add a Comment
There are no comments for this tip
Your Comment:
(how to format)
Rate This Tip:

Verify Humanity:
Sorry, we know it's annoying, but please enter the characters shown in the image to the left so that we know you're an actual person and not an evil spammer. Thanks.
       

Related Tips

How to tell if ipod touch is 2g

95% positive, 1 comment - last added on Aug 19, 2009 at 8:39 pm
– Tip added by an anonymous user on May 08, 2009 at 6:37 pm

Provisioning Profile not showing up correctly in XCode

100% positive, 0 comments
– Tip added by an anonymous user on Feb 07, 2009 at 2:06 pm

iPhone button images not showing correctly

100% positive, 0 comments
– Tip added by an anonymous user on Mar 08, 2009 at 6:16 pm

Creating iPhone development certificates

100% positive, 0 comments
– Tip added by an anonymous user on Feb 07, 2009 at 7:18 am

Set the default window size for new projects in Xcode

100% positive, 0 comments
– Tip added by an anonymous user on Dec 18, 2008 at 10:28 am

How to Add Images to iPhone 3Gs

95% positive, 1 comment - last added on Aug 19, 2009 at 8:37 pm
– Tip added by ferfer on Aug 19, 2009 at 5:46 pm

Getting iPhone screenshots out of XCode

Categories: XCode iPhone screenshots
91% positive, 6 comments - last added on Sep 30, 2009 at 10:24 am
– Tip added by an anonymous user on Jun 05, 2009 at 10:54 am

How to Set Up iTunes Syncing on Your iPhone 3G

100% positive, 3 comments - last added on Oct 09, 2009 at 3:28 pm
– Tip added by ferfer on Aug 20, 2009 at 5:55 am

Ipod trick and tips

100% positive, 0 comments
– Tip added by i know ! on Dec 23, 2008 at 12:13 am

Getting accepted to the iPhone developer program quicker

Categories: iPhone development ADC
100% positive, 0 comments
– Tip added by an anonymous user on Jan 23, 2009 at 5:21 pm

How to convert DVD to FLV, SWF?

100% positive, 1 comment - last added on May 04, 2009 at 1:40 am
– Tip added by an anonymous user on Mar 30, 2009 at 9:00 pm

Send files to and from an iPhone over Bluetooth

100% positive, 0 comments
– Tip added by an anonymous user on Mar 14, 2009 at 7:49 am

Customize the iPod icons on the iPhone

25% positive, 0 comments
– Tip added by an anonymous user on Mar 05, 2009 at 5:36 pm

The font used on iPhone buttons

100% positive, 0 comments
– Tip added by an anonymous user on Feb 27, 2009 at 1:32 pm

Getting applications settings to show up on the iPhone

Categories: iPhone development
100% positive, 0 comments
– Tip added by an anonymous user on Jan 29, 2009 at 11:52 am

Get more apps on an iPhone or iPod Touch

no ratings, 0 comments
– Tip added by an anonymous user on Nov 05, 2009 at 10:25 am

Connecting an iPhone to Linux

Categories: iPhone iPod Touch ubuntu
no ratings, 0 comments
– Tip added by an anonymous user on Mar 06, 2009 at 3:08 pm

Killing hung iPhone apps

no ratings, 0 comments
– Tip added by an anonymous user on Jan 04, 2009 at 3:48 pm

shortcut to showing the song list

no ratings, 0 comments
– Tip added by an anonymous user on Jan 02, 2009 at 7:25 am

iPhone with dead touch screen

Categories: iPhone repair Apple
no ratings, 0 comments
– Tip added by an anonymous user on Dec 23, 2008 at 6:42 pm