它是一个真正的声明UIGesturesRecognizer
有效替代提供给我们的任何手动控制通过UIGestures VS手动控制
- touchesBegan:withEvent:
– touchesMoved:withEvent:
– touchesEnded:withEvent:
– touchesCancelled:withEvent:
只是看看这里的确认。
感谢
它是一个真正的声明UIGesturesRecognizer
有效替代提供给我们的任何手动控制通过UIGestures VS手动控制
- touchesBegan:withEvent:
– touchesMoved:withEvent:
– touchesEnded:withEvent:
– touchesCancelled:withEvent:
只是看看这里的确认。
感谢
如果您说这些方法不会被调用,这是不正确的。
如果您说UIGesture
可以做这种方法,答案是肯定的,通过UIGestures,您可以使用您发布的这些方法完成所有工作。并可能以简单的方式来编码:)
您可以获取手势,视图和其他人的状态。 并与UIGestures很容易知道,如果是点击,长按,轻扫等
编辑看一看:
你一个例子,添加PanGesture,将后处理:
UIPanGestureRecognizer* pan = [[UIPanGestureRecognizer alloc] initWithTarget:self action:@selector(panGestureHandler:)];
[self.view addGestureRecognizer:pan];
你的方法将处理油锅,将接收到的手势,并且会像:
-(void)panGestureHandler:(UIPanGestureRecognizer *)gesture{
CGPoint postionInView = [gesture translationInView:self.view];
[yourView setCenter:postionInView];
}
说过去,我有一个gameLoop在1/60秒到'drawRect',如果'touchesMoved'会在新的位置重画屏幕上的对象。这种方法现在是否被UIGestureRecognizer高估了? (pan) – JAM 2012-03-28 00:46:03
我编辑了答案,我不知道我是否完全明白你的观点。 – ggrana 2012-03-28 01:00:57
非常酷;谢谢 – JAM 2012-03-28 01:05:42