tags:

views:

343

answers:

1

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

I have a scrollview and subclass-ed it inorder 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?

+1  A: 

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

pgb