While I was working with touch events and gesture recognition , I ran into a peculiar issue. While I swipe down the screen, touches began and touches moved got called and also touches ended at the last. But many times touches cancelled event was called while trying to swipe. In some cases, I was trying to rotate the image slowly, and touches cancelled event got called and it stopped the occurrence of touches moved events. It ended the gesture event in middle and I have to start from the first, i.e from touches began event. We were thinking that touches got cancelled because of the memory warning, but we had no memory warning in our application at all.I had no clue why touches cancelled event got called.

My objective was to rotate an image based on touch events. I was experimenting some code snippets with two different ways. One method is by using UIResponder chain and getting UITouch events(began ,moved and ended). Another method is by using UIGestureRecognizer. I implemented both methods in single application and was developing an application to rotate image. After few experiments, I stick with the first method. I removed only the implementation methods of UIGestureRecognizer.

After struggling a lot, surfing through google, I got an answer. It was due to UIGestureRecognizer. If a gesture recognizer recognizes its gesture, it unbinds the remaining touches of that gesture from their view.The window cancels the previously delivered touches with a touches Cancelled message. After removing all the UIGestureRecognizer codes, now it works fine. I also read that we can also turn off the touches cancel in view property to avoid this behavior, which is yet to be tested.