我能够检测到旋转手势,但我只需要检测从右到左的那个。
非常感谢任何帮助。
谢谢!
Best Answer-推荐答案 strong>
我假设您正在使用 UIRotationGestureRecognizer 来检测旋转。你应该有这样的东西:
UIRotationGestureRecognizer *gestureRecognizer = [[UIRotationGestureRecognizer alloc] initWithTarget:self actionselector(gestureRecognizerAction];
[self.view addGestureRecognizer:gestureRecognizer];
和:
- (void)gestureRecognizerActionUIRotationGestureRecognizer *)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
}
}
通过这种方式,您将只能检测到从右到左的旋转。
关于ios - 仅检测从右到左的旋转手势,我们在Stack Overflow上找到一个类似的问题:
https://stackoverflow.com/questions/17733389/
|