I need to get my iPad to use the desktop version of a user agent however so far this is not working
Code Block let webConfiguration = WKWebViewConfiguration() if #available(iOS 13.0, *) { webConfiguration.defaultWebpagePreferences.preferredContentMode = .desktop } else { // Fallback on earlier versions } let webView = WKWebView(frame: .zero, configuration: webConfiguration) webView.evaluateJavaScript("navigator.userAgent") { result, _ in var userAgent: UIAlertController! userAgent = UIAlertController(title: "user agent", message: result as? String, preferredStyle: .alert) userAgent.addAction(UIAlertAction(title: "Ok", style: .default, handler: nil)) UIApplication.shared.windows.first?.rootViewController?.present(userAgent, animated: false, completion: nil) }