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 consumer faucets on the appointment slot, that motion opens iOS Calendar app.
The hyperlinks to the occasions tons don’t comprise any common hyperlinks that seem like calendar hyperlinks, so it looks as if iOS is doing a little bizarre nonsense.
This subject happens on each actual system and the simulator, working iOS 16.1
Here’s a video screenshot of what occurs: LINK
ViewController accountable 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.heart = self.view.heart
activityIndicator.hidesWhenStopped = true
activityIndicator.type = 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 further 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 consumer agent, disabling hyperlink previews, however nothing appears to work and I’ve no clue the place to even start. Is there a solution to block an app from opening another apps utterly?
[ad_2]