PDA

View Full Version : UITouch detection in frame




beardedpig
Dec 20, 2008, 05:39 AM
hi,

! have an image displayed in a UIImageView and on top of this view ! have another UIImageView that has a translucent circle which frames the underlying image.

The top UIImageView has no user interaction or multitouch but the underlying UIImageView does.

therefore I only want touches to be processed by te visible portion of the image not when the user touches any part of the frame.

from my understanding all touche events get passed to the UIImageView that lies underneath the frame so even if the user clicks the frame the touch is processed.

so do i have to do some advanced math using the touch location to determine if the touch occured inside the frame thus on the image?

thanks



kainjow
Dec 22, 2008, 02:07 AM
Should be fairly easy with something like CGRectContainsPoint().