Please tell me, I have 2 classes. There is a load_shop() function that enables the display of the webView. If I call a function from the first class ViewController then the function is executed and the webView is displayed, and if from another class CheckUpdate the function is executed (print is output) but the webView […]
- Tags *) { UIApplication.shared.open(url, and if from another class CheckUpdate the function is executed (print is output) but the webView is not displayed. What could be the problem?, animated: true), AppURL: (info?.trackViewUrl)!) } } } } } } private f, AppURL: String) { guard let appName = CheckUpdate.shared.getBundle(key: "CFBundleName") else { return } //Bundle.appName() l, completion: nil) } }, completionHandler: nil) } else { UIApplication.shared.openURL(url) } } alertControll, configuration: webConfiguration) webView.scrollView.bounces = false; let myURL = URL(string:"https://google.com") le, currentVersion) } else { print("Needs update: AppStore Version: \(appStoreAppVersion) > Current v, currentVersion) DispatchQueue.main.async { let topController: UIViewController = (UIAppli, didFinish navigation: WKNavigation!) { CheckUpdate.shared.showUpdate(withConfirmation: false) } func close() {, Error?) -> Void) -> URLSessionDataTask? { // You should pay attention on the country that your app is located, error) } } task.resume() return task } func getBundle(key: String) -> String?, error) } else if appStoreAppVersion == currentVersion { self.first_class.load_shop(), error) in do { if let error = error { throw error } guard let data = data else { thr, error) in if let appStoreAppVersion = info?.version { if let error = error { prin, Force: Bool, Force: force, from: data) print(result.results) guard let info = result.results.first else {, I have 2 classes. There is a load_shop() function that enables the display of the webView. If I call a function from the first class ViewCont, in my case I put Brazil */br/* // Você deve prestar atenção em que país o app está disponível, invalidResponse } class LookupResult: Decodable { var results: [AppInfo] } class AppInfo: Decodable { var version: String var t, let url = URL(string: "http://itunes.apple.com/br/lookup?bundleId=\(identifier)") else { DispatchQueue.main.async {, message: alertMessage, nil) } catch { completion(nil, no meu caso eu coloquei Brasil */br/* guard let identifier = self.getBundle(key: "CFBundleIdentifier"), ofType: "plist") else { fatalError("Couldn't find file 'Info.plist'.") } // 2 - Add the file to a dictionary, OPTIONS, please tell me), preferredStyle: .alert) if !Force { let notNowButton = UIAlertAction(title: "Not now", response, style: .default) { (action:UIAlertAction) in guard let url = URL(string: AppURL) else { return }, style: .default) alertController.addAction(notNowButton) } let updateButton = UIAlertAction(title: "Update", VersionError.invalidBundleInfo) } return nil } let task = URLSession.shared.dataTask(with: ur, WKNavigationDelegate { var webView: WKWebView! override func viewDidLoad() { super.viewDidLoad() l, WKScriptMessageHandler, WKUIDelegate