Search code examples
iosuiviewmulti-touchmultitasking-gestures

How to catch losing focused event in iOS application?


My application receives and process all touch events, received through UIWindow object. So, for every touch event I create a record and at any moment I can check how much fingers on the screen... Everething worked fine until I tried to use system gestures (switch between tasks, call task manager)... In this case i received all four touchesBegan events, but not tochesEnded. In other words my application doesn't receive any touch events if they are become system gestures.

The question is: How can I catch ALL touch events?

Thank You!


Solution

  • The trick is to handle correctly touchesCancelled:withEvent: which is fired when the application lose focus on multitasking gesture.