• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Contain touches within UIImageView only
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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

  • Follow-Ups:
    • Re: Contain touches within UIImageView only
      • From: glenn andreas <email@hidden>
  • Prev by Date: Re: Migrating changed objects between contexts
  • Next by Date: Custom Title Bar Drawing
  • Previous by thread: Re: Control Appearance on Textured Window Sheet (Solution)
  • Next by thread: Re: Contain touches within UIImageView only
  • Index(es):
    • Date
    • Thread