• 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
Tracking Multiple Touches For Appropriate Label
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Tracking Multiple Touches For Appropriate Label


  • Subject: Tracking Multiple Touches For Appropriate Label
  • From: Chunk 1978 <email@hidden>
  • Date: Mon, 7 Dec 2009 19:12:35 -0500

for 2 days now i've had unsuccessful attempts at trying to track
UITouches that share the same view.

i have a plain, full screen view that accepts multiple touches.  i
have 3 labels titled "Touch1", "Touch2", "Touche3".  all i'm trying to
accomplish is to output the coordinates of the touches thru the labels
and update the appropriate label according to the number of touches on
the screen.

so if one finger is touching and moving around the screen, Touch1 will
display it's coordinates.  if 2 fingers are touching or moving around
the screen than Touch2 will show the second's touches coordinates
while Touch1 is still being tracked by the first finger.  if 3 fingers
are touching the screen, Touch3 will show the coordinates of the 3rd
finger.

my current, non working state:

- (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event
	{
	if ([[[event allTouches] anyObject] view] == self)
		{
		for (UITouch *touch in touches)
			{
			CGPoint touchPoint = [[touches anyObject] locationInView:self];
			switch ([touches count])
				{
				case 1:	[self Touch1:touchPoint];
						break;
				case 2:	[self Touch2:touchPoint];
						break;
				case 3:	[self Touch3:touchPoint];
						break;
				case 4:	[self Touch4:touchPoint];
						break;
				}
			}
		}
	}
_______________________________________________

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: Tracking Multiple Touches For Appropriate Label
      • From: mmalc Crawford <email@hidden>
  • Prev by Date: the ABLocalizedPropertyOrLabel() function
  • Next by Date: Image gets wrong resolution value on Snow Leopard
  • Previous by thread: the ABLocalizedPropertyOrLabel() function
  • Next by thread: Re: Tracking Multiple Touches For Appropriate Label
  • Index(es):
    • Date
    • Thread