Question

I have a UIView subclass where hitTest: withEvent: is overridden. Every time a hit test registers, the view logs its tag.

Ex: Click

Console: You Touched View: 3 You Touched View: 3 You Touched View: 3

My question: Why does it do it three times? I need it to trigger something other than an NSLog and I'm afraid that it will trigger that three times also. I could easily work around the triple trigger, but I was wondering if there was a better explanation.

Was it helpful?

Solution

I suggest you log the event information as well as the uiview's tag. It could be getting called by multiple events - touchDown, touchUp, etc.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top