我用这个方法将我的东西移到视野中:
- (void)touchesMoved:(NSSet *)touches withEvent:(UIEvent *)event
我用这个方法写了下一封信:
NSLog(@"event: %@", event);
并获得此结果 :
event: <UITouchesEvent: 0x310d00> timestamp: 5277.16 touches: {(
<UITouch: 0x3f1110> phase: Moved tap count: 1 window: <UIWindow: 0x3117d0; frame = (0 0; 768 1024); layer = <UIWindowLayer: 0x30cb20>> view: <UIView: 0x330520; frame = (0 0; 768 1024); transform = [0, -1, 1, 0, 0, 0]; autoresize = W+H; layer = <CALayer: 0x330550>> location in window: {279, 677} previous location in window: {305, 694} location in view: {347, 279} previous location in view: {330, 305},
<UITouch: 0x4a1a710> phase: Stationary tap count: 1 window: <UIWindow: 0x3117d0; frame = (0 0; 768 1024); layer = <UIWindowLayer: 0x30cb20>> view: (null) location in window: {412, 89} previous location in window: {413, 89} location in view: {412, 89} previous location in view: {413, 89}
)}
我可以看到我所有的触摸(目前只有两只触摸),
我的问题是如何接触?
这需要移动我的东西。
现在我要用这个:
UITouch *touch = [[event allTouches] anyObject];
CGPoint touchLocation = [touch locationInView:self.view];
但当我移动我的东西时,我得到所有触摸的价值。如何处理只是第一次触摸?
非常感谢!