Ken
Ken

Reputation:

How do I find out the tag of a view I am touching

I am having trouble determining the tag of the view I am touching.

I have a scroll view and subclassed it in order to capture touch down events (I have pictures on the subview). However, I need to determine which picture I touched down.

I want to determine that tag of the subview, but I am getting random results (mostly tag 0). Whats the proper way of capturing this?

Upvotes: 0

Views: 671

Answers (1)

pgb
pgb

Reputation: 25001

You can try using UIView hitTest. It will return you the subview the user is touching.

Upvotes: 1

Related Questions