Looks like no one’s replied in a while. To start the conversation again, simply ask a new question.

How to have multiple touches

I have written my code that allows multiple UIImageViews to move, but not at the same time. How can I change this to make the images move at the same time with different touches?


-(void)touchesMoved:(NSSet *)touches withEvent:(UIEvent *)event{

UITouch *DragTop = [[event allTouches] anyObject];

CGPoint locationTop = [DragTop locationInView:DragTop.view];

UITouch *DragBottom = [[event allTouches] anyObject];

CGPoint locationBottom = [DragBottom locationInView:DragBottom.view];

if(CGRectContainsPoint(CGRectMake(0, 284, 320, 284), locationBottom)){

Player.center = [DragBottom locationInView:DragBottom.view];

}

if(CGRectContainsPoint(CGRectMake(0, 0, 320, 284), locationTop)){

Computer.center = [DragTop locationInView:DragTop.view];

}

}


Thanks!

MacBook Pro (13-inch Mid 2012), OS X Mavericks (10.9)

Posted on Jan 27, 2014 2:51 PM

Reply

There are no replies.

How to have multiple touches

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple ID.