ios - Find out, that the touch position is in Imageview -
I try to run some code when my finger goes to one place, where the image is the view
I have defined the position of the image view:
cgrt imagehop = myImage.frame; and the position of the actual touch position:
UITT * myTouch = [[touches all the object] ObjectOutInx: 0]; CGPoint current page = [myTouch locationInView: self.view]; I did try it with CGPointEqualToPoint then I tried it with CGRectContainsPoint because it did not even work, Because, when the image and the current context have the same X coordinate, my "some code" is running (my finger does not move into the image, they are only those x positions. Y positions are completely different). How can I say, when my finger (touched even in the method) has come anywhere in touch / image, then run some code or method?
Thanks for the answer.
Method method in your touch, you can try something like this: < Pre> - (Zero) Turing Brinjal: (NSSET *) touches the event: (UIIvent *) event {UITT * Touch = [touches any object]; If ([touch] == myImgView) {NSLOG (@ "My image was touched"); }} It tells you that when your image touches the eye. Make sure you set userInteractionEnabled to YES in your imageView.
Comments
Post a Comment