diff --git a/flutter_inappwebview_ios/ios/Classes/InAppBrowser/InAppBrowserWebViewController.swift b/flutter_inappwebview_ios/ios/Classes/InAppBrowser/InAppBrowserWebViewController.swift index 3f59398b..8cecb3a5 100755 --- a/flutter_inappwebview_ios/ios/Classes/InAppBrowser/InAppBrowserWebViewController.swift +++ b/flutter_inappwebview_ios/ios/Classes/InAppBrowser/InAppBrowserWebViewController.swift @@ -145,7 +145,7 @@ public class InAppBrowserWebViewController: UIViewController, InAppBrowserDelega } } - if let wId = windowId { + if windowId != nil { channelDelegate?.onBrowserCreated() webView?.runWindowBeforeCreatedCallbacks() } else { diff --git a/flutter_inappwebview_ios/ios/Classes/InAppWebView/FlutterWebViewController.swift b/flutter_inappwebview_ios/ios/Classes/InAppWebView/FlutterWebViewController.swift index 1772b5bc..2348c078 100755 --- a/flutter_inappwebview_ios/ios/Classes/InAppWebView/FlutterWebViewController.swift +++ b/flutter_inappwebview_ios/ios/Classes/InAppWebView/FlutterWebViewController.swift @@ -138,7 +138,7 @@ public class FlutterWebViewController: NSObject, FlutterPlatformView, Disposable } load(initialUrlRequest: initialUrlRequest, initialFile: initialFile, initialData: initialData) } - else if let wId = windowId { + else if windowId != nil { webView.runWindowBeforeCreatedCallbacks() } } diff --git a/flutter_inappwebview_ios/ios/Classes/InAppWebView/WebMessage/WebMessageChannelChannelDelegate.swift b/flutter_inappwebview_ios/ios/Classes/InAppWebView/WebMessage/WebMessageChannelChannelDelegate.swift index c95e9a28..5750a89d 100644 --- a/flutter_inappwebview_ios/ios/Classes/InAppWebView/WebMessage/WebMessageChannelChannelDelegate.swift +++ b/flutter_inappwebview_ios/ios/Classes/InAppWebView/WebMessage/WebMessageChannelChannelDelegate.swift @@ -39,7 +39,7 @@ public class WebMessageChannelChannelDelegate : ChannelDelegate { if let webView = webMessageChannel?.webView, let ports = webMessageChannel?.ports, ports.count > 0 { let index = arguments!["index"] as! Int let port = ports[index] - var message = WebMessage.fromMap(map: arguments!["message"] as! [String: Any?]) + let message = WebMessage.fromMap(map: arguments!["message"] as! [String: Any?]) var ports: [WebMessagePort] = [] if let notConnectedPorts = message.ports { diff --git a/flutter_inappwebview_ios/ios/Classes/InAppWebView/WebViewChannelDelegate.swift b/flutter_inappwebview_ios/ios/Classes/InAppWebView/WebViewChannelDelegate.swift index 880810f5..dc0046fa 100644 --- a/flutter_inappwebview_ios/ios/Classes/InAppWebView/WebViewChannelDelegate.swift +++ b/flutter_inappwebview_ios/ios/Classes/InAppWebView/WebViewChannelDelegate.swift @@ -509,7 +509,7 @@ public class WebViewChannelDelegate : ChannelDelegate { break case .postWebMessage: if let webView = webView { - var message = WebMessage.fromMap(map: arguments!["message"] as! [String: Any?]) + let message = WebMessage.fromMap(map: arguments!["message"] as! [String: Any?]) let targetOrigin = arguments!["targetOrigin"] as! String var ports: [WebMessagePort] = [] diff --git a/flutter_inappwebview_ios/ios/Classes/PrintJob/PrintJobSettings.swift b/flutter_inappwebview_ios/ios/Classes/PrintJob/PrintJobSettings.swift index 0049c421..ab520c3c 100644 --- a/flutter_inappwebview_ios/ios/Classes/PrintJob/PrintJobSettings.swift +++ b/flutter_inappwebview_ios/ios/Classes/PrintJob/PrintJobSettings.swift @@ -148,7 +148,7 @@ public class PrintJobSettings: ISettings { } override func getRealSettings(obj: PrintJobController?) -> [String: Any?] { - var realOptions: [String: Any?] = toMap() + let realOptions: [String: Any?] = toMap() return realOptions } }