iphone编程中如何知道touchMoved方法的方向?
- (void)touchesMoved:(NSSet *)touches withEvent:(UIEvent *)event {
}
我想在上面的方法中调用两个方法,
-(void) movingUp{
}
-(void) movingDown {
}
当用户向上移动触摸方向时我想调用 moveUp 方法,当用户向下触摸方向时调用 moveDown , 我怎样才能做到这一点, 我使用了手势,但它正在感应向上或向下移动的一次触摸,但我想根据用户的触摸移动(向上或向下)一次又一次地调用这些方法
帮助!
- (void)touchesMoved:(NSSet *)touches withEvent:(UIEvent *)event {
}
I want to call two methods in this above method,
-(void) movingUp{
}
-(void) movingDown {
}
I want to call moveUp Method when user will move his touch upward direction, and moveDown when user will touch downward direction,
How can I do this,
I used gestures, but it is sensing one touch moving up or down, but I want call these methods again and again, as per user movement of touch, either upside or downwards
Help!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
TouchesMoved: 被调用时设置了 Touches ;你可以使用它:
The touchesMoved: is called with a touches set ; you can use it :
CGPoint 开始点、tappoint;
CGPoint beginPoint, tappoint;