iOS 13.4 wkwebview 添加 UITapGestureRecognizer手势

在13.4系统中,给wkwebview添加了手势,发现手势不响应了。但是低版本都正常????
    WKWebViewConfiguration *confinguration = [[WKWebViewConfiguration alloc] init];
     confinguration.selectionGranularity = WKSelectionGranularityDynamic;
     confinguration.allowsInlineMediaPlayback = YES;
     WKPreferences *preferences = [WKPreferences new];
     preferences.javaScriptEnabled = YES;
     preferences.javaScriptCanOpenWindowsAutomatically = YES;
     confinguration.preferences = preferences;
    
    _webView = [[WKWebView alloc] initWithFrame:CGRectMake(0, 0, [UIScreen mainScreen].bounds.size.width, [UIScreen mainScreen].bounds.size.height) configuration:confinguration];
    _webView.navigationDelegate = self;
    [self.view addSubview:_webView];
    
    NSURLRequest *request = [NSURLRequest requestWithURL:[NSURL URLWithString:@"https://hike-doc-online-h5.zhihuishu.com/newStuViewer.html?WOPISrc=https://file.zhihuishu.com/zhs_yufa_150820/ablecommons/demo/202005/90a0d24e5cbc4a338c156fb471ff4654.pptx"]];
    [_webView loadRequest:request];
    
    
    //添加手势
    UITapGestureRecognizer *tap = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(tapAction:)];
    tap.delegate = self;
    [self.webView addGestureRecognizer:tap];
#pragma mark Action
- (void)tapAction:(UITapGestureRecognizer *)tap
{
    NSLog(@"@@@我被点击了");
}

#pragma mark UIGestureRecognizerDelegate
- (BOOL)gestureRecognizer:(UIGestureRecognizer *)gestureRecognizer shouldRecognizeSimultaneouslyWithGestureRecognizer:(UIGestureRecognizer *)otherGestureRecognizer
{
    return YES;
}

自定义打印之后,发现响应的都在 WKChildScrollView类上边
并且手势个数不一致

//不响应
; target= <(action=delayed:, target=)>>,
; target= <(action=handlePan:, target=)>>,
; target= <(action=_handleKnobLongPressGesture:, target=)>; numberOfTapsRequired = 0; minimumPressDuration = 0.1>,
; target= <(action=_handleKnobLongPressGesture:, target=)>; numberOfTapsRequired = 0>,
; target= <(action=_handleKnobHoverGesture:, target=)>>,
<_UIDragAutoScrollGestureRecognizer: 0x28389cd20; state = Possible; cancelsTouchesInView = NO; delaysTouchesEnded = NO; view = ; target= <(action=_handleAutoScroll:, target=)>>


//正常
; target= <(action=delayed:, target=)>>,
; target= <(action=handlePan:, target=)>>,
; target= <(action=_handleKnobLongPressGesture:, target=)>>,
<_UIDragAutoScrollGestureRecognizer: 0x6000016231e0; state = Possible; cancelsTouchesInView = NO; delaysTouchesEnded = NO; view = ; target= <(action=_handleAutoScroll:, target=)>>

请教哪位大佬了解过??

你可能感兴趣的:(iOS 13.4 wkwebview 添加 UITapGestureRecognizer手势)