iOS滑动手势 - 滑动时间延迟

时间:2013-04-03 15:55:16

标签: iphone ios objective-c

我有UIWebview我正在使用SwipeGesture加载多个网址我正在刷到下一页。我已使用此代码执行此操作,

UISwipeGestureRecognizer* swipeUpGestureRecognizer = [[UISwipeGestureRecognizer alloc] initWithTarget:self action:@selector(handleSwipeUpFrom:)];
swipeUpGestureRecognizer.direction = UISwipeGestureRecognizerDirectionUp;

handleSwipeUpFrom方法中我正在加载webview中的下一个网址。 一切正常完美。但滑动工作如此迅速。我想对它做出一些延迟,任何想法......

1 个答案:

答案 0 :(得分:1)

可能有点麻烦,但如果没有人有更清洁的解决方案,请试试这个:

- (void)handleSwipeUpFrom:(id)sender
{
    [self performSelector:@selector(anotherMethod:) withObject:object afterDelay:1.0];
}
相关问题