In the example project aurioTouch application delegate the code indicates (and I’ve read elsewhere) that the touch event object passed to touchesBegan, touchesMoved, and touchesEnded will be the same object while it is still a single set of user actions, such as touching and moving a finger. When I override UIScrollView and implement these methods, the events that I get back are different objects. What am I missing here?
In the example project aurioTouch application delegate the code indicates (and I’ve read elsewhere)
Share
You are right that the
UIEventis reused when delivering touch events for one gesture. From the docs:I presume the difference in behavior for your case results from the special event handling done by
UIScrollView. Scroll views delay event delivery because they need to detect a scrolling intent by the user (swipe gestures). So they have to have a way of keeping UIEvents around—probably copying them to make sure they retain their original state. This might be the reason you see different objects.Note that all of the above is only guessing.