In XCode, I created a xib file with several image view, some stacked on others. The entire view has a single view controller that has a connection to every image view. I guess my first question is, are all the image views direct subviews of the entire view? Anyways, when ever the over all image view is touched, I detect it with touches began / touches moved. It works perfectly. However, there is one image view in particular that I want to know if it is being touched. How can I, from the master view's touches began / touches moved, find out if a sub view within it was touched? I want to do it this way because everything else I tried did not work. For the sub view, i created a view controller and set its view to the sub view in question. I set up the touches began / touches moved methods inside the controller, but they do not react to touches at all.
Asked
Active
Viewed 86 times
0
-
1http://stackoverflow.com/questions/3679978/iphone-determine-if-touch-occurred-in-subview-of-a-uiview – iDev Dec 12 '12 at 18:36
1 Answers
0
For UIImageView instances, you need to explicitly do setUserInterActionEnabled=YES

Srikanth
- 1,725
- 2
- 10
- 11
-
Tried that, but no luck. I ended up using the CGRectContainsPoint function to do the trick. – Gregory-Turtle Dec 13 '12 at 03:53