我是iPhone
开发人员的新手,
我制作了 epub 阅读器并在我的webview
我想要的是,当用户right swipe gesture
第二次做然后我想导航到新页面时,我不想在用户right swipe gesture
第一次做任何事情时做任何事情。
UISwipeGestureRecognizer *swipeRight
有没有类似的方法,
if(swipeRight.touch.count > 2)
{
// do this
}
任何帮助都会得到帮助。
提前致谢 !
编辑
-(void)scrollViewDidScroll:(UIScrollView *)scrollView{
float scrollViewHeight = scrollView.frame.size.height;
float scrollContentSizeHeight = scrollView.contentSize.height;
float scrollOffset = scrollView.contentOffset.y;
if (scrollOffset == 0)
{
swipeUp = [[UISwipeGestureRecognizer alloc] initWithTarget:self action:@selector(swipeLeftAction:)];
swipeUp.direction = UISwipeGestureRecognizerDirectionUp;
swipeUp.numberOfTouchesRequired=2;
swipeUp.delegate = (id<UIGestureRecognizerDelegate>)self;
swipeUp.cancelsTouchesInView=YES;
[_webview addGestureRecognizer:swipeUp];
}
else if (scrollOffset + scrollViewHeight == scrollContentSizeHeight)
{
swipeDown = [[UISwipeGestureRecognizer alloc] initWithTarget:self action:@selector(swipeRightAction:)];
swipeDown.direction = UISwipeGestureRecognizerDirectionDown;
swipeDown.numberOfTouchesRequired=2;
swipeDown.delegate = (id<UIGestureRecognizerDelegate>)self;
swipeDown.cancelsTouchesInView=YES;
[_webview addGestureRecognizer:swipeDown];
}