我能够检测到旋转手势,但我只需要从右到左检测到一个。
我真的很感激任何帮助。
谢谢!
答案 0 :(得分:4)
我假设您正在使用UIRotationGestureRecognizer来检测旋转。你应该有这样的东西:
UIRotationGestureRecognizer *gestureRecognizer = [[UIRotationGestureRecognizer alloc] initWithTarget:self action:@selector(gestureRecognizerAction:)];
[self.view addGestureRecognizer:gestureRecognizer];
和
- (void)gestureRecognizerAction:(UIRotationGestureRecognizer *)gestureRecognizer
{
if (gestureRecognizer.rotation > 0) {
//rotation in one side - lets say from left to right
} else {
//rotation in other side - lets say from right to left
}
}
通过这种方式,您只能检测从右到左的旋转。