Tapping on time in WKWebView triggers Calendar iOS Swift

[ad_1]

I’m utilizing WKWebView to load an appointment scheduling web page from a URL, which shows occasions tons. When person faucets on the appointment slot, that motion opens iOS Calendar app.
The hyperlinks to the occasions tons don’t include any common hyperlinks that seem like calendar hyperlinks, so it looks like iOS is performing some bizarre nonsense.
This situation happens on each actual machine and the simulator, working iOS 16.1

Here’s a video screenshot of what occurs: LINK

ViewController chargeable for appointment scheduling:

    class AppointmentVC: UIViewController, WKNavigationDelegate {

    @IBOutlet weak var webView: WKWebView!
    
    var activityIndicator: UIActivityIndicatorView = UIActivityIndicatorView()
    
    override func viewDidLoad() {
        tremendous.viewDidLoad()
        navigationController?.setNavigationBarHidden(false, animated: false)
        webView.navigationDelegate = self
        
        webView.customUserAgent = "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/55.0.2883.95 Safari/537.36"
        webView.allowsLinkPreview = false
        webView.allowsBackForwardNavigationGestures = true
        

        
        activityIndicator.middle = self.view.middle
        activityIndicator.hidesWhenStopped = true
        activityIndicator.model = UIActivityIndicatorView.Type.grey
        view.addSubview(activityIndicator)
        activityIndicator.startAnimating()

        let url: URL = URL(string: "https://...")!
        let urlRequest: URLRequest = URLRequest(url: url)
        webView.load(urlRequest)
        // Do any extra setup after loading the view.
    }
    
    func webView(_ webView: WKWebView, didFinish navigation: WKNavigation!) {
        activityIndicator.stopAnimating()
    }

}

This isn’t the anticipated habits and I attempted random issues like altering person agent, disabling hyperlink previews, however nothing appears to work and I’ve no clue the place to even start. Is there a method to block an app from opening another apps fully?

[ad_2]

Leave a Reply