Get all touches without UIEvent
Question
I'm looking for a way to get all the current touches even if no event has occurred. I know about [UIEvent allTouches]
but I need to be able to see "these are all the touches on the screen" even if none of them has changed. It seems like it should be possible because allTouches
can access touches which haven't been updated, so the phone is tracking them.
Solution
Override touchesBegan and touchesEnded, and compare the current point against the cached point from the event.
OTHER TIPS
Try hitTest:withEvent and filter with pointInside:withEvent.
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow