Contain touches within UIImageView only
Contain touches within UIImageView only
- Subject: Contain touches within UIImageView only
- From: Chunk 1978 <email@hidden>
- Date: Wed, 2 Dec 2009 13:23:15 -0500
i have a custom class for a UIImageView which contains touch methods.
at launch, the custom UIImageView is added (by interface builder) as a
subview to the main UIViewController's view.
i can't seem to make the touch methods only trigger if they are within
the custom UIImageView. for some reason, touchesBegan works fine, but
touchesMoved will continue to fire even if the CGPoint is no longer on
the custom UIImageView
- (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event
{
if ([[[event allTouches] anyObject] view] == self)
NSLog(@"Touches Began");
}
- (void)touchesMoved:(NSSet *)touches withEvent:(UIEvent *)event
{
if ([[[event allTouches] anyObject] view] == self)
NSLog(@"Touches Moved");
}
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden