Hi all,
So I'm looking for a way two drag two (or more) UIImageViews around at the same time, I guess that's what's being done in games like air hockey where u have 2 people playing, each with there own 'paddle'
So far to get my my images, in this example pic1 and pic2 to move around I'm using this code:
Code:
-(void)touchesMoved:(NSSet *)touches withEvent:(UIEvent *)event {
UITouch *touch = [[event allTouches] anyObject];
if ([touch view] == pic1) {
CGPoint location = [touch locationInView:self.view];
pic1.center = location;
}
if ([touch view] == pic2) {
CGPoint location = [touch locationInView:self.view];
pic2.center = location;
}
}
But obviously this just lets you drag one or the other, and while i'm dragging one I can't move the other at the same time.
Any help here would be greatly appreciated, i know this question has been asked before but I couldn't find the answer yet, so hopefully someone can point out something obvious i'm overlooking XD