Tag: drag

拖动,缩放和旋转多个UIImageviews

到目前为止,我可以移动,缩放和旋转所有对象,但是多个对象一起移动。 我希望他们分开移动。 我想我必须改变objectatIndex为1,但它只是崩溃。 我已经使用了下面的代码: – (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event { NSArray *allTouches = [touches allObjects]; UITouch* t; if([[event allTouches] count]==1){ if (CGRectContainsPoint([Birdie frame], [[allTouches objectAtIndex:0] locationInView:theimageView]) && CGRectContainsPoint([imageViewauto frame], [[allTouches objectAtIndex:0] locationInView:theimageView])) { t=[[[event allTouches] allObjects] objectAtIndex:0]; touch1=[t locationInView:nil]; } }else{ t=[[[event allTouches] allObjects] objectAtIndex:0]; touch1=[t locationInView:nil]; t=[[[event allTouches] allObjects] objectAtIndex:1]; touch2=[t locationInView:nil]; } } […]