Ios 在WKWebView中滑动手势

Ios 在WKWebView中滑动手势,ios,objective-c,uiwebview,wkwebview,Ios,Objective C,Uiwebview,Wkwebview,因此,我在UICollectionViewCell中有一个WKWebView。我必须打开几个网页,但这些网页正在通过覆盖touchmove事件消耗滚动,如下所示: document.addEventListener('touchmove', function(e) { e.preventDefault(); } 我已尝试将滑动手势添加到WKWebView及其superview触摸移动:在superview中也不会被调用。我无法在webview上禁用用户交互,因为我希望能够点击并与web

因此,我在
UICollectionViewCell
中有一个
WKWebView
。我必须打开几个网页,但这些网页正在通过覆盖
touchmove
事件消耗滚动,如下所示:

document.addEventListener('touchmove', function(e) {
    e.preventDefault();
}
我已尝试将滑动手势添加到
WKWebView
及其
superview
<代码>触摸移动:在superview中也不会被调用。我无法在webview上禁用
用户交互
,因为我希望能够点击并与webview交互

我尝试通过注入脚本覆盖网页的现有
touchmove
事件:

WKUserScript *script = [[WKUserScript alloc]initWithSource:@"window.ontouchmove = function() { \
                            window.webkit.messageHandlers.touchmoved.postMessage('Touches Moved..'); \
                                return true; \
                            };" injectionTime:WKUserScriptInjectionTimeAtDocumentEnd forMainFrameOnly:NO];

    WKUserScript *docscript = [[WKUserScript alloc]initWithSource:@"document.ontouchmove = function() { \
                            window.webkit.messageHandlers.touchmoved.postMessage('Doc Touches Moved..'); \
                            return true; \
                            };" injectionTime:WKUserScriptInjectionTimeAtDocumentEnd forMainFrameOnly:NO];
    [config.userContentController addUserScript:script];
    [config.userContentController addUserScript:docscript];
    [config.userContentController addScriptMessageHandler:self name:@"touchmoved"];
我在
didReceiveScriptMessage
中收到回调,但它无法启用滚动

有没有办法为这些网页启用滚动或添加滑动手势