Wondering if anyone has written or come across a good way to log to the console the view that a touch occurred in. I know touchesEnded: can be implemented, but my problem is that something mysterious is blocking touches on my views and I don't know what it is. I would just like to know what is intercepting the touches.
I would like to log to the console:
"Touch occurred in view: nameOfSomeUIView"
Each UITouch
object has a view property described as "The view in which the touch initially occurred." You can subclass UIWindow
and override the sendEvent
method. In your implementation of sendEvent
you can call [super sendEvent: event]
and after that inspect the view properties of all the touches that belong to the event.
As a general tip:
Check the hitTest
method of your views if your UITouches
do not behave as expected. You can override this method to see which view should receive touches.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With