From d7def718a19b9e3d4d8d5a2d6a5cfede00ef558b Mon Sep 17 00:00:00 2001 From: jcesarmobile Date: Mon, 16 Sep 2019 17:36:42 +0200 Subject: [PATCH] fix(ios): call webview.load on main thread on setServerBasePath (#1967) --- ios/Capacitor/Capacitor/CAPBridgeViewController.swift | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/ios/Capacitor/Capacitor/CAPBridgeViewController.swift b/ios/Capacitor/Capacitor/CAPBridgeViewController.swift index 5ab531026..559f8beb3 100644 --- a/ios/Capacitor/Capacitor/CAPBridgeViewController.swift +++ b/ios/Capacitor/Capacitor/CAPBridgeViewController.swift @@ -444,7 +444,9 @@ public class CAPBridgeViewController: UIViewController, CAPBridgeDelegate, WKScr public func setServerBasePath(path: String) { setServerPath(path: path) let request = URLRequest(url: URL(string: hostname!)!) - _ = getWebView().load(request) + DispatchQueue.main.async { + _ = self.getWebView().load(request) + } } override open var preferredInterfaceOrientationForPresentation: UIInterfaceOrientation {