I have to use a protocol.
public protocol WKNavigationDelegate : NSObjectProtocol {
@available(iOS 8.0, *)
optional func webView(_ webView: WKWebView, decidePolicyFor navigationAction: WKNavigationAction) async -> WKNavigationActionPolicy
I have some questions.
- Since async is only allowed after iOS 15, why this API says its availbility to be iOS 8.0?
- I want to use this method in iOS 14 and 15, so I have to use the sync version of this function as well. How can I use it together? So code will run the sync version on iOS 14 and run the async version on iOS 15?
Xcode told me I could not do that
Method 'webView(:decidePolicyFor:decisionHandler:)' with Objective-C selector 'webView:decidePolicyForNavigationAction:decisionHandler:' conflicts with method 'webView(:decidePolicyFor:)' with the same Objective-C selector