UINavigationViewController interactivePopGestureRecognizer

如何打开交互手势,在自定义返回按钮的情况下
self.navigationController.interactivePopGestureRecognizer.enable = YES;
self.navigationController.interactivePopGestureRecognizer.delegate = self
 

开发中遇到的问题, UIWebView 的情况下,如何支持 交互手势

- (BOOL)gestureRecognizer:(UIGestureRecognizer *)gestureRecognizer shouldRecognizeSimultaneouslyWithGestureRecognizer:(UIGestureRecognizer *)otherGestureRecognizer
{
    return YES;
}

- (BOOL)gestureRecognizer:(UIGestureRecognizer *)gestureRecognizer shouldBeRequiredToFailByGestureRecognizer:(UIGestureRecognizer *)otherGestureRecognizer
{
    return [gestureRecognizer isKindOfClass:UIScreenEdgePanGestureRecognizer.class];
}

for (UIGestureRecognizer *gestureRecognizer in _colView.gestureRecognizers) {
        [gestureRecognizer requireGestureRecognizerToFail:self.navigationController.interactivePopGestureRecognizer];
    }

应该避免的问题

Thread 1, Queue : com.apple.main-thread
#0  0x3a80cb66 in objc_msgSend ()
#1  0x32e23f9a in -[UIGestureRecognizer _delegateCanPreventGestureRecognizer:] ()
#2  0x32cce418 in -[UIGestureRecognizer _isExcludedByGesture:] ()
#3  0x32c9410e in _UIGestureRecognizerUpdate ()
#4  0x32ccd1b4 in -[UIWindow _sendGesturesForEvent:] ()
#5  0x32cccb62 in -[UIWindow sendEvent:] ()
#6  0x32ca1f58 in -[UIApplication sendEvent:] ()
#7  0x32ca0746 in _UIApplicationHandleEventQueue ()
#8  0x304e2f26 in __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ ()
#9  0x304e23ee in __CFRunLoopDoSources0 ()
#10 0x304e0bde in __CFRunLoopRun ()
#11 0x3044b540 in CFRunLoopRunSpecific ()
#12 0x3044b322 in CFRunLoopRunInMode ()
#13 0x351822ea in GSEventRunModal ()
#14 0x32d021e4 in UIApplicationMain ()
#15 0x000df478 in main at /path/to/main.m:17
#16 0x000df398 in start ()

self.navigationController.interactivePopGestureRecognizer.delegate = nil or
self.navigationController.interactivePopGestureRecognizer.enabled = NO
in viewWillDisappear

for (UIGestureRecognizer *gestureRecognizer in _colView.gestureRecognizers) {
        [gestureRecognizer requireGestureRecognizerToFail:self.navigationController.interactivePopGestureRecognizer];
    }


连接:

http://stackoverflow.com/questions/23261304/navigation-bar-title-bug-with-interactivepopgesturerecognizer

http://stackoverflow.com/questions/21366185/can-a-uiwebview-in-a-uinavigationcontroller-allow-the-ios-7-swipe-to-pop-built-i

https://developer.apple.com/library/ios/documentation/UIKit/Reference/UIScreenEdgePanGestureRecognizer_class/index.html#//apple_ref/occ/cl/UIScreenEdgePanGestureRecognizer


  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值