Limits in multiple touches in iPhone OS

Most people are familiar with the multiple touch interface in the iPhone OS. Using two fingers for pinching and rotating are common in many applications. Some applications even allow you to use three fingers. In developing my latest app called multiTouch the Game, I found a limitation in the iPhone SDK that is not documented anywhere.
If you are not familiar with how to use touch routines, the 'iPhone OS Programming Guide' is a very good reference. Throughout the documentation, there are references to 'one or more fingers'. Through experimentation, I found that the 'one or more' to be actually 'up to five'.
The rest of this document will describe what happens when you have more than five touches occurring at the same time.
There are four main events that are used when a finger is touching the screen.
- (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event;
- (void)touchesMoved:(NSSet *)touches withEvent:(UIEvent *)event;
- (void)touchesEnded:(NSSet *)touches withEvent:(UIEvent *)event;
- (void)touchesCancelled:(NSSet *)touches withEvent:(UIEvent *)event
Each one of these events contains a NSSet of UITouch objects. A single UITouch objects represents one finger. When an event is called, one or more UITouch objects may be sent. Depending on when a particular finger is in motion, the NSSet can contain up to five objects. As long as there is a change in finger status at least one of these events are called. If the user moves a finger before setting another down, then you will receive a Began, Moved, Began sequence. To determine when all the fingers have been lifted, you have to track how many are currently down, since the touchesEnded event is called when one or more fingers are lifted, which may or may not be all the fingers.
When you place the sixth finger down, the touchesCancelled event is called. Once this occurs, then information about the other finger positions are lost. You cannot get any more Moved or Ended events for those fingers, even though they may still be touching the screen. The limit of five makes sense, since most people only have five fingers on one hand. According to the Apple documentation "the touch sequence is cancelled by a system event, such as an incoming phone call." Perhaps six fingers down triggers an exception. Regardless, you should handle the touchesCancelled event and reset whatever is necessary. It is interesting that even after the touchesCancelled is called, if you remove some of your fingers, but leave the others on, only the new touches will create an Event. The old fingers won't register, but they are still counted, since if you put more than five fingers back on, another Cancelled event is triggered.
You can try out my 'multiTouch the Game' application on the App Store. It's free, and fun. I had hoped to use up to eight fingers, but had to limit it to five because of the OS restriction. Maybe in a future OS version the limit will increase.

Paddler,
Make sure that all the smart playlists are set for live updating.
Also, if you are listening on your iPod, many updates will not be reflected until the next time you sync.

Similar Messages

  • Does the ipod touch of iphone support Calender groups?

    Hi,
    I use an ipod touch 1.1.4 firmware. In my iCal calendar, I have 3 groups. When I sync the iCal calenders with the ipod touch in iTunes, the ipod touch displays the events fine, but classifies them all as one group. Do the ipod touch or iphone support multiple groups in the calendar? If they don't is there a way to get around that limitation? Thanks.

    No need to hope for a 3rd party solution - this will be a feature of the v2.0 software ($10 for your IPT, available in "early July", perhaps at the same time as the 3G iPhone launch on July 11th).
    We can "see" right now. Have a look at this image (taken from this page of the Apple website), which clearly shows syncing with multiple calendars from iCal.
    Hope this helps...

  • I had my ipod touch and iphone synced to itunes on my computer that just bit the dust...If I don't replace the computer, can I still add stuff to these two devices?

    I had my ipod touch and iphone synced to itunes on my PC and basically managed my photos and music, etc. from there.  However recently my computer died and I am considering replacing it with an ipad eventually.  Can I still add stuff onto my two devices?  And if so, am I limited to apple store purchases only?  Can I retain all the photos and non-apple store downloaded music that is presently on these two devices?  Any guidance in this area will be very welcome!

    Morning @mb,
    Thanks for using Apple Support Communities.
    For more information on this, take a look at this article:
    iTunes: Transferring media from your iPhone, iPad, iPod touch, or iPod
    http://support.apple.com/kb/HT1209
    Music imported from a CD or another source
    iTunes cannot transfer this media back to a computer. Make sure to back up your iTunes Library, or you can use iTunes Match2.
    Best of luck,
    Mario

  • My husband and I have separate iTunes accounts and multiple devices (iPads, iPhones, iPods etc) how do we share our music and apps between our devices if we have different iTunes accounts.

    Help! My husband and I have multiple devices (iPad, iPhone, iPod ) that we we have linked to individual iTunes accounts ie he has his account with iPad, iPhone, PC and iPod linked/sync and I have my account with iPhone, iPad, iPad mini, PC etc.. How do we share our music and apps across/between our accounts?

    It probably means that only one of you can use iCloud or at least sync calender/contacts with it. I would guess that you could manually manage the other phone as you have before.

  • Since latest update, Sound Check on Ipod touch and Iphone doesn't work.

    My playlists have always played at an even volume before Sunday's software updates to Itunes, Ipod touch, and Iphone.  Now my playlist volumes are all over the map.  I teach a fitness class in a large room to 70 people, and this is ruining it!!  Apple support on the phone told me it should work.  Yes, it did work until the update, and I didn't change anything until I noticed it wasn't working anymore.
    Now I have uninstalled/reinstalled Itunes, restored my Ipod Touch as a new Ipod, and even deleted and reloaded my music.  Still not working!!!

    Just a stab in the dark, but check:
    Settings -> WiFi -> (your WiFi network) -> HTTP Proxy
    Set the Proxy to Auto and see if that helps.

  • I have multiple computers and iPhones and now iTunes will not allow my wife to load applications or use her own iTunes playlists.  How can I setup each device for each user correctly?

    We have multiple computers and iPhone devices which I have passed on to other family members, such as my wife.  Now she is not able to load apps to her devices, eventhough it appear she is logged into her own iTunes account.  How can I setup iTunes correctly on each device?  Currently, there is one PC and one Mac laptop and we each have iPhones, with one other family member not able to use his 'passed-down' device for iTunes, also.

    Hello dal1820
    Check out the article below on how to use multiple devices with one computer. The main idea that I want to point out is to have different users for each person as it is the easy way to make sure that no issue happen when syncing.
    How to use multiple iPhone, iPad, or iPod devices with one computer
    http://support.apple.com/kb/ht1495
    Regards,
    -Norm G.

  • Greetings: I have multiple iPads and iPhones. I want all to be able to be able to stream to our Apple TV. All of the docs I see say you must have the same Apple ID for all the devices, but we each have our own Apple ID. Is this just a doc short coming?

    Greetings: I have multiple iPads and iPhones. I want all to be able to be able to stream to our Apple TV. All of the docs I see say you must have the same Apple ID for all the devices, but we each have our own Apple ID. Is this just a doc short coming?

    You can each have your own ID for your own iTunes accounts, but in order for a device to stream via AirPlay to the same Apple TV, everything must use the same homesharing ID. This is not the same as your iTunes account ID (although it can be for one of the devices)

  • How to delete multiple contacts in iphone 5s

    Is there an easy way to delet multiple contacts on iphone 5s annd 5c. I can delete them one at a time, but wondered if theres a way to do some of them but not all.

    No, there's no mass delete or partial mass delete option.
    If these are iCloud based contacts, you may find it easier to go to www.icloud.com and delete them there.

  • How to delete multiple contacts in iphone 5

    how to delete multiple contacts in iphone 5

    This is a good little app to check for duplicates and delete multiple contacts all at the same time: https://itunes.apple.com/gb/app/delete-duplicates-+-contacts/id508504148?mt=8

  • How many times can i use the limited warranty on my Apple iPhone 5, I just broke mine after getting a brand new one. Also, can I extend my warranty?

    How many times can i use the limited warranty on my Apple iPhone 5, I just broke mine after getting a brand new one. Also, can I extend my warranty?

    If you purchased AppleCare + within 30 days of getting your iPhone 5 you are allowed 2 instances of breakage replacement with a $49 deductible. If you do not have AppleCare + accidental breakage is not covered under you warranty, you can do an out-of-warranty replacement for $229.

  • How to delete multiple songs from iPhone 5S without losing form iTunes? The unchek function has not worked. Why?

    How to delete multiple songs from iPhone 5S without losing form iTunes? The unchek function has not worked. Why?

    Sorry I had to reply through your profile Gail from Maine, my PC has java issues. In any event, when I delete them directly from my device everything is perfect and cool. However, in the rare instance I want to add new music that I actually buy in stores (I know, quite the unique and old-fashioned idea...but hey Im an audiophile) once I upload the tunes, everytime I sync my library it re-adds everything that I spent hours deleting. In a perfect world, I thought I could maintain a massive iTunes Library, and add or delete (remove) songs from my iPhone to save both memory or keep my iPhone selections more current/apt to my musical "tastes" at that time. I know about the whole playlist thing, but thought there might be an easier way. ie - checking/un-checking the little box next to the song name, and then doing a sync. Again, everytime I do this however, whether everything is checked or un-checked it adds the entire library! So frustrating. Any suggestions. Thank you graiously in advance for your help.

  • I cannot get my ipod touch or iphone to be recognized by Itunes on my mac mini. Only when i download itunes each time afresh, will it show up the first time. Then these devices will not be recognized at other times. Is it because i am not uninstalling it

    I cannot get my ipod touch or iphone to be recognized by Itunes on my mac mini. Only when i download itunes each time afresh, will it show up the first time. Then these devices will not be recognized subsequently. Is it because i am not uninstalling itunes before I download it? Surely this is a basic thing, ie that my devices need to recognize each other?

    After you dry the iPod:
    How to fix a wet iPod or iPhone | eHow.comfix-wet-ipod-iphone.html
    Connect the iPod to a charging source overnight and then try:
    - iOS: Not responding or does not turn on
    - Also try DFU mode after try recovery mode
    How to put iPod touch / iPhone into DFU mode « Karthik's scribblings
    - If not successful and you can't fully turn the iOS device fully off, let the battery fully drain. After charging for an least an hour try the above again.
    - Try on another computer
    - If still not successful that usually indicates a hardware problem and an appointment at the Genius Bar of an Apple store is in order.
    Apple Retail Store - Genius Bar       
    If iTunses can see the iPod you can backup the iPod
    iOS: How to back up
    http://support.apple.com/kb/HT1766and copy media from the iPod
    Recovering your iTunes library from your iPod or iOS device: Apple Support Communities
    If iTunes does not see the iPod then its contents are lost

  • My iPod Touch and iPhone 3G do not get recognized as a device by iTunes

    Both, iPod Touch and iPhone 3G don't show up on my macbook and do not get recognized as a device by iTunes. I switched cables, restarted macbook (and the other devices) and did an iTunes update. Still nada, niente, rien, nichts and nothing... any guidance or help? appreciate it, thanks

    Try here:
    iPhone, iPad, iPod touch: Device not recognized in iTunes for Mac OS X
    Do not forget the Additional Information topic near the bottom of the article.

  • IPod Touch (and iPhone) can't find Belkin N Wireless Router

    I spent over an hour looking for an answer to this problem today and accidently found a solution - so am posting the answer.
    Have a 2 year old Belkin N Wireless Router (model F5D8236-4v1) with SSID broadcasting on and WPA/WPA2-Personal (PSK) security selected.
    All the Windows laptops in the house could see the wireless SSID and could successfully log in after entering the WPA/WPA2 password.
    Both iPod Touch and iPhone 3GS could NOT see the SSID. Also entering the wireless router IP address directly instead of the SSID did NOT work.
    After an hour of looking for solutions on-line, including:
    - Tried no security
    - Tried WEP 64 and 128 bit security
    then stumbled across a thread in a forum where someone referred to changing a "-" (dash) in an SSID name to a character. So tried this.
    The old SSID name includes spaces - "name name1 name2". I deleted the spaces, and the problem was solved.
    This Belkin router comes with a default name of BelkinN_WirelessXXXXXX, but does not say in the online help to NOT use spaces in the SSID name. And again, the Windows laptops could see the wireless Router while it had the SSID name INCLUDING the spaces in the name.
    Hope this saves at least one person going through the same wasted hour.

    Click on the blue arrow to the right of the network name, if IP address starts with "169." ,restart your router. It should connect properly after your router reboots in a minute or two.

  • Ipod touch or iphone does not show up in itunes

    Ok. So I have had this ongoing problem. Whenever I install an update to either itunes or my touch or iphone, itunes no longer detects the device. I have tried deleting the apple mobile device usb driver and letting it reinstall, powering on and off the devices and the computer, differnt usb ports, different usb cables. The only way I can get itunes to see the devices again is to completely remove all apple sw and reinstall. This is too time consuming to put up with  anymore. Now today, after a complete reinstall last night and no updated software of any kind itunes does not see my devices again. Windows detects the devices and mobile device usb driver comes up in device manager with no conflicts.
    Unless someone can point me in the right direction, I am giving up on itunes and apple.
    Windows 7 with latest gen itouch and iphone 4s.

    Hello theLexx,
    The following article is quite relevant to the issue that you're experiencing.
    iOS: Device not recognized in iTunes for Windows
    http://support.apple.com/kb/TS1538
    Cheers,
    Allen

Maybe you are looking for

  • How to troubleshoot "Exit Code: 6" error when installing CS5 (Mac)

    So hey. It's been a long, long couple of days trying to figure out this error, and even longer (and more frustrating) trying to actually find someone from Adobe who can actually give me customer support. You think they'd have a bit more streamlined a

  • Is it worth buying the iPhone 5 in Malaysia?

    Hi guys! I'm going to Malaysia in a few days where the iPhone 5 retails for 700 for the 16 and 780 for the 32GB model. So that's about $100 cheaper than it is in Australia. So I was just wondering if it's safe and good to buy it in Malaysia. I will b

  • OS upgrade on macbook pro changed two-finger scrolling direction

    I just upgraded my macbook pro to Mountain Lion and the scrolling direction on the track pad has changed.  Now when I drag my fingers down to scroll down on a page, it goes up, not down anymore.  And if I drag up, the page goes down.  How do I fix it

  • Presentation won't run

    I hope someone can help me with this. I have a very large presentation (554 slides, 80MB) that was doing just fine until the other day. Sometime last week it stopped saving, but I didn't realize that the asterisk was still there on the top of the win

  • Help..Iphoto will not launch!

    My iphoto would not launch...its icon simply bounced on the bottom dial and nothing would happen. Trying to solve the problem, I deleted com.apple.iphoto.plist from the user>library>preferences. Now, I am not sure if I should have deleted this sectio