[ERROR] decidePolicyForNavigationAction was not called

2020. 11. 3. 16:10개발자료/iOS


반응형

decidePolicyForNavigationAction 함수만 선언하고 decisionHandler을 호출하지 않아서 발생

# Swift

func webView(_ webView: WKWebView, decidePolicyFor navigationAction: WKNavigationAction, decisionHandler: @escaping (WKNavigationActionPolicy) -> Void) {
	decisionHandler(.allow)
}

# Objective-C

- (void)webView:(WKWebView *)webView decidePolicyForNavigationAction:(WKNavigationAction *)navigationAction decisionHandler:(void (^)(WKNavigationActionPolicy))decisionHandler {
	decisionHandler(WKNavigationActionPolicyAllow);
}

 

반응형