我想要一個正常的UINavigationController
回掃式手勢在基本上是UIWebView
瀏覽器的視圖控制器上工作。默認情況下,UIWebView似乎不允許識別UINavigationController
向後滑動手勢。UINavigationController中的UIWebView是否允許識別iOS 7輕掃式內置手勢?
如果我將UIWebView.delegate
設置爲我的視圖控制器,並添加下面的方法,它將正確識別UINavigationController's
反向滑動。
- (BOOL)gestureRecognizer:(UIGestureRecognizer *)gestureRecognizer shouldRecognizeSimultaneouslyWithGestureRecognizer:(UIGestureRecognizer *)otherGestureRecognizer {
return YES;
}
但是完成該手勢(其彈出UIWebView's
視圖控制器)後,當我做另一手勢它崩潰。 (下面的堆棧跟蹤。)通過「其他手勢」,我的意思是簡單地滾動瀏覽控制器上的UIWebView
,我在刷卡後彈出。
問題總是YES
返回值搞亂了UIWebView手勢的正常交互嗎?看起來我只想讓導航手勢始終爲YES,但是我希望webview手勢可以做任何他們通常做的事情,但我不能僅僅撥打[super gestureRecognizer:shouldRecognizeSimultaneouslyWithGestureRecognizer:]
來獲得該行爲。坦率地說,我很驚訝UIWebView委託被髮送到手勢回調。
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()