From 7c1cd442bbd1a5a9f41d435f00dfc65bc974eb48 Mon Sep 17 00:00:00 2001 From: Michal Srutek Date: Wed, 20 Dec 2023 15:45:58 +0100 Subject: [PATCH 1/3] Swift code improvements --- .../ios/Classes/CredentialDatabase.swift | 17 ++++++------ .../FindInteractionChannelDelegate.swift | 2 +- .../FindInteractionController.swift | 12 ++++----- .../HeadlessInAppWebView.swift | 5 ++-- .../InAppBrowserWebViewController.swift | 2 +- .../InAppWebView/ContextMenuSettings.swift | 4 +-- .../Classes/InAppWebView/InAppWebView.swift | 26 +++++++++---------- .../ios/Classes/MyCookieManager.swift | 9 ++++--- .../ios/Classes/MyWebStorageManager.swift | 5 ++-- .../PullToRefresh/PullToRefreshControl.swift | 5 ++-- 10 files changed, 46 insertions(+), 41 deletions(-) diff --git a/flutter_inappwebview_ios/ios/Classes/CredentialDatabase.swift b/flutter_inappwebview_ios/ios/Classes/CredentialDatabase.swift index 8a48275f..bc660244 100755 --- a/flutter_inappwebview_ios/ios/Classes/CredentialDatabase.swift +++ b/flutter_inappwebview_ios/ios/Classes/CredentialDatabase.swift @@ -9,8 +9,9 @@ import Foundation public class CredentialDatabase: ChannelDelegate { static let METHOD_CHANNEL_NAME = "com.pichillilorenzo/flutter_inappwebview_credential_database" - var plugin: SwiftFlutterPlugin? - static var credentialStore = URLCredentialStorage.shared + static let credentialStore = URLCredentialStorage.shared + + private var plugin: SwiftFlutterPlugin? init(plugin: SwiftFlutterPlugin) { super.init(channel: FlutterMethodChannel(name: CredentialDatabase.METHOD_CHANNEL_NAME, binaryMessenger: plugin.registrar!.messenger())) @@ -44,7 +45,7 @@ public class CredentialDatabase: ChannelDelegate { let host = arguments!["host"] as! String let urlProtocol = arguments!["protocol"] as? String let urlPort = arguments!["port"] as? Int ?? 0 - var realm = arguments!["realm"] as? String; + var realm = arguments!["realm"] as? String if let r = realm, r.isEmpty { realm = nil } @@ -64,7 +65,7 @@ public class CredentialDatabase: ChannelDelegate { let host = arguments!["host"] as! String let urlProtocol = arguments!["protocol"] as? String let urlPort = arguments!["port"] as? Int ?? 0 - var realm = arguments!["realm"] as? String; + var realm = arguments!["realm"] as? String if let r = realm, r.isEmpty { realm = nil } @@ -80,14 +81,14 @@ public class CredentialDatabase: ChannelDelegate { let host = arguments!["host"] as! String let urlProtocol = arguments!["protocol"] as? String let urlPort = arguments!["port"] as? Int ?? 0 - var realm = arguments!["realm"] as? String; + var realm = arguments!["realm"] as? String if let r = realm, r.isEmpty { realm = nil } let username = arguments!["username"] as! String let password = arguments!["password"] as! String - var credential: URLCredential? = nil; + var credential: URLCredential? = nil var protectionSpaceCredential: URLProtectionSpace? = nil for (protectionSpace, credentials) in CredentialDatabase.credentialStore.allCredentials { @@ -116,12 +117,12 @@ public class CredentialDatabase: ChannelDelegate { let host = arguments!["host"] as! String let urlProtocol = arguments!["protocol"] as? String let urlPort = arguments!["port"] as? Int ?? 0 - var realm = arguments!["realm"] as? String; + var realm = arguments!["realm"] as? String if let r = realm, r.isEmpty { realm = nil } - var credentialsToRemove: [URLCredential] = []; + var credentialsToRemove: [URLCredential] = [] var protectionSpaceCredential: URLProtectionSpace? = nil for (protectionSpace, credentials) in CredentialDatabase.credentialStore.allCredentials { diff --git a/flutter_inappwebview_ios/ios/Classes/FindInteraction/FindInteractionChannelDelegate.swift b/flutter_inappwebview_ios/ios/Classes/FindInteraction/FindInteractionChannelDelegate.swift index 950f622a..4b1a43aa 100644 --- a/flutter_inappwebview_ios/ios/Classes/FindInteraction/FindInteractionChannelDelegate.swift +++ b/flutter_inappwebview_ios/ios/Classes/FindInteraction/FindInteractionChannelDelegate.swift @@ -7,7 +7,7 @@ import Foundation -public class FindInteractionChannelDelegate : ChannelDelegate { +public class FindInteractionChannelDelegate: ChannelDelegate { private weak var findInteractionController: FindInteractionController? public init(findInteractionController: FindInteractionController, channel: FlutterMethodChannel) { diff --git a/flutter_inappwebview_ios/ios/Classes/FindInteraction/FindInteractionController.swift b/flutter_inappwebview_ios/ios/Classes/FindInteraction/FindInteractionController.swift index d3ebf169..cff9cc9e 100644 --- a/flutter_inappwebview_ios/ios/Classes/FindInteraction/FindInteractionController.swift +++ b/flutter_inappwebview_ios/ios/Classes/FindInteraction/FindInteractionController.swift @@ -8,14 +8,14 @@ import Foundation import Flutter -public class FindInteractionController : NSObject, Disposable { - - static var METHOD_CHANNEL_NAME_PREFIX = "com.pichillilorenzo/flutter_inappwebview_find_interaction_"; - var plugin: SwiftFlutterPlugin? +public class FindInteractionController: NSObject, Disposable { + static let METHOD_CHANNEL_NAME_PREFIX = "com.pichillilorenzo/flutter_inappwebview_find_interaction_" + var webView: InAppWebView? var channelDelegate: FindInteractionChannelDelegate? - var settings: FindInteractionSettings? - var shouldCallOnRefresh = false + + private var plugin: SwiftFlutterPlugin? + private var settings: FindInteractionSettings? private var _searchText: String? = nil var searchText: String? { diff --git a/flutter_inappwebview_ios/ios/Classes/HeadlessInAppWebView/HeadlessInAppWebView.swift b/flutter_inappwebview_ios/ios/Classes/HeadlessInAppWebView/HeadlessInAppWebView.swift index 57234cd2..5d13086d 100644 --- a/flutter_inappwebview_ios/ios/Classes/HeadlessInAppWebView/HeadlessInAppWebView.swift +++ b/flutter_inappwebview_ios/ios/Classes/HeadlessInAppWebView/HeadlessInAppWebView.swift @@ -7,8 +7,9 @@ import Foundation -public class HeadlessInAppWebView : Disposable { +public class HeadlessInAppWebView: Disposable { static let METHOD_CHANNEL_NAME_PREFIX = "com.pichillilorenzo/flutter_headless_inappwebview_" + var id: String var channelDelegate: HeadlessWebViewChannelDelegate? var flutterWebView: FlutterWebViewController? @@ -24,7 +25,7 @@ public class HeadlessInAppWebView : Disposable { } public func onWebViewCreated() { - channelDelegate?.onWebViewCreated(); + channelDelegate?.onWebViewCreated() } public func prepare(params: NSDictionary) { diff --git a/flutter_inappwebview_ios/ios/Classes/InAppBrowser/InAppBrowserWebViewController.swift b/flutter_inappwebview_ios/ios/Classes/InAppBrowser/InAppBrowserWebViewController.swift index 3f59398b..2303b9d2 100755 --- a/flutter_inappwebview_ios/ios/Classes/InAppBrowser/InAppBrowserWebViewController.swift +++ b/flutter_inappwebview_ios/ios/Classes/InAppBrowser/InAppBrowserWebViewController.swift @@ -11,7 +11,7 @@ import WebKit import Foundation public class InAppBrowserWebViewController: UIViewController, InAppBrowserDelegate, UIScrollViewDelegate, UISearchBarDelegate, Disposable { - static var METHOD_CHANNEL_NAME_PREFIX = "com.pichillilorenzo/flutter_inappbrowser_"; + static let METHOD_CHANNEL_NAME_PREFIX = "com.pichillilorenzo/flutter_inappbrowser_" var closeButton: UIBarButtonItem! var reloadButton: UIBarButtonItem! diff --git a/flutter_inappwebview_ios/ios/Classes/InAppWebView/ContextMenuSettings.swift b/flutter_inappwebview_ios/ios/Classes/InAppWebView/ContextMenuSettings.swift index a1df58d9..9009e536 100644 --- a/flutter_inappwebview_ios/ios/Classes/InAppWebView/ContextMenuSettings.swift +++ b/flutter_inappwebview_ios/ios/Classes/InAppWebView/ContextMenuSettings.swift @@ -8,8 +8,8 @@ import Foundation public class ContextMenuSettings: ISettings { - - var hideDefaultSystemContextMenuItems = false; + + var hideDefaultSystemContextMenuItems = false override init(){ super.init() diff --git a/flutter_inappwebview_ios/ios/Classes/InAppWebView/InAppWebView.swift b/flutter_inappwebview_ios/ios/Classes/InAppWebView/InAppWebView.swift index c4390995..9d9f2cc6 100755 --- a/flutter_inappwebview_ios/ios/Classes/InAppWebView/InAppWebView.swift +++ b/flutter_inappwebview_ios/ios/Classes/InAppWebView/InAppWebView.swift @@ -14,7 +14,7 @@ public class InAppWebView: WKWebView, UIScrollViewDelegate, WKUIDelegate, WKDownloadDelegate, PullToRefreshDelegate, Disposable { - static var METHOD_CHANNEL_NAME_PREFIX = "com.pichillilorenzo/flutter_inappwebview_" + static let METHOD_CHANNEL_NAME_PREFIX = "com.pichillilorenzo/flutter_inappwebview_" var id: Any? // viewId var plugin: SwiftFlutterPlugin? @@ -26,14 +26,14 @@ public class InAppWebView: WKWebView, UIScrollViewDelegate, WKUIDelegate, var settings: InAppWebViewSettings? var pullToRefreshControl: PullToRefreshControl? var findInteractionController: FindInteractionController? - var webMessageChannels: [String:WebMessageChannel] = [:] + var webMessageChannels: [String: WebMessageChannel] = [:] var webMessageListeners: [WebMessageListener] = [] var currentOriginalUrl: URL? var inFullscreen = false var preventGestureDelay = false - static var sslCertificatesMap: [String: SslCertificate] = [:] // [URL host name : SslCertificate] - static var credentialsProposed: [URLCredential] = [] + private static var sslCertificatesMap: [String: SslCertificate] = [:] // [URL host name : SslCertificate] + private static var credentialsProposed: [URLCredential] = [] var lastScrollX: CGFloat = 0 var lastScrollY: CGFloat = 0 @@ -103,14 +103,14 @@ public class InAppWebView: WKWebView, UIScrollViewDelegate, WKUIDelegate, set { super.frame = newValue - self.scrollView.contentInset = UIEdgeInsets.zero; + self.scrollView.contentInset = .zero if #available(iOS 11, *) { // Above iOS 11, adjust contentInset to compensate the adjustedContentInset so the sum will // always be 0. if (scrollView.adjustedContentInset != UIEdgeInsets.zero) { - let insetToAdjust = self.scrollView.adjustedContentInset; + let insetToAdjust = self.scrollView.adjustedContentInset scrollView.contentInset = UIEdgeInsets(top: -insetToAdjust.top, left: -insetToAdjust.left, - bottom: -insetToAdjust.bottom, right: -insetToAdjust.right); + bottom: -insetToAdjust.bottom, right: -insetToAdjust.right) } } } @@ -2214,13 +2214,13 @@ public class InAppWebView: WKWebView, UIScrollViewDelegate, WKUIDelegate, if let certEntry:Dictionary = dict as? Dictionary { // grab the identity let identityPointer:AnyObject? = certEntry["identity"]; - let secIdentityRef:SecIdentity = (identityPointer as! SecIdentity?)!; + let secIdentityRef:SecIdentity = (identityPointer as! SecIdentity?)! // grab the trust - let trustPointer:AnyObject? = certEntry["trust"]; - let trustRef:SecTrust = trustPointer as! SecTrust; + let trustPointer:AnyObject? = certEntry["trust"] + let trustRef:SecTrust = trustPointer as! SecTrust // grab the cert - let chainPointer:AnyObject? = certEntry["chain"]; - identityAndTrust = IdentityAndTrust(identityRef: secIdentityRef, trust: trustRef, certArray: chainPointer!); + let chainPointer:AnyObject? = certEntry["chain"] + identityAndTrust = IdentityAndTrust(identityRef: secIdentityRef, trust: trustRef, certArray: chainPointer!) } } else { print("Security Error: " + securityError.description) @@ -2228,7 +2228,7 @@ public class InAppWebView: WKWebView, UIScrollViewDelegate, WKUIDelegate, print(SecCopyErrorMessageString(securityError,nil) ?? "") } } - return identityAndTrust; + return identityAndTrust } func createAlertDialog(message: String?, responseMessage: String?, confirmButtonTitle: String?, completionHandler: @escaping () -> Void) { diff --git a/flutter_inappwebview_ios/ios/Classes/MyCookieManager.swift b/flutter_inappwebview_ios/ios/Classes/MyCookieManager.swift index 5bcbb601..235d8f9f 100755 --- a/flutter_inappwebview_ios/ios/Classes/MyCookieManager.swift +++ b/flutter_inappwebview_ios/ios/Classes/MyCookieManager.swift @@ -11,8 +11,9 @@ import WebKit @available(iOS 11.0, *) public class MyCookieManager: ChannelDelegate { static let METHOD_CHANNEL_NAME = "com.pichillilorenzo/flutter_inappwebview_cookiemanager" - var plugin: SwiftFlutterPlugin? - static var httpCookieStore = WKWebsiteDataStore.default().httpCookieStore + static let httpCookieStore = WKWebsiteDataStore.default().httpCookieStore + + private var plugin: SwiftFlutterPlugin? init(plugin: SwiftFlutterPlugin) { super.init(channel: FlutterMethodChannel(name: MyCookieManager.METHOD_CHANNEL_NAME, binaryMessenger: plugin.registrar!.messenger())) @@ -64,13 +65,13 @@ public class MyCookieManager: ChannelDelegate { let path = arguments!["path"] as! String let domain = arguments!["domain"] as? String MyCookieManager.deleteCookie(url: url, name: name, path: path, domain: domain, result: result) - break; + break case "deleteCookies": let url = arguments!["url"] as! String let path = arguments!["path"] as! String let domain = arguments!["domain"] as? String MyCookieManager.deleteCookies(url: url, path: path, domain: domain, result: result) - break; + break case "deleteAllCookies": MyCookieManager.deleteAllCookies(result: result) break diff --git a/flutter_inappwebview_ios/ios/Classes/MyWebStorageManager.swift b/flutter_inappwebview_ios/ios/Classes/MyWebStorageManager.swift index 131afc48..a375fdfb 100755 --- a/flutter_inappwebview_ios/ios/Classes/MyWebStorageManager.swift +++ b/flutter_inappwebview_ios/ios/Classes/MyWebStorageManager.swift @@ -11,8 +11,9 @@ import WebKit @available(iOS 9.0, *) public class MyWebStorageManager: ChannelDelegate { static let METHOD_CHANNEL_NAME = "com.pichillilorenzo/flutter_inappwebview_webstoragemanager" - var plugin: SwiftFlutterPlugin? - static var websiteDataStore = WKWebsiteDataStore.default() + static let websiteDataStore = WKWebsiteDataStore.default() + + private var plugin: SwiftFlutterPlugin? init(plugin: SwiftFlutterPlugin) { super.init(channel: FlutterMethodChannel(name: MyWebStorageManager.METHOD_CHANNEL_NAME, binaryMessenger: plugin.registrar!.messenger())) diff --git a/flutter_inappwebview_ios/ios/Classes/PullToRefresh/PullToRefreshControl.swift b/flutter_inappwebview_ios/ios/Classes/PullToRefresh/PullToRefreshControl.swift index 7d114475..5df23c17 100644 --- a/flutter_inappwebview_ios/ios/Classes/PullToRefresh/PullToRefreshControl.swift +++ b/flutter_inappwebview_ios/ios/Classes/PullToRefresh/PullToRefreshControl.swift @@ -8,8 +8,9 @@ import Foundation import Flutter -public class PullToRefreshControl : UIRefreshControl, Disposable { - static var METHOD_CHANNEL_NAME_PREFIX = "com.pichillilorenzo/flutter_inappwebview_pull_to_refresh_"; +public class PullToRefreshControl: UIRefreshControl, Disposable { + static let METHOD_CHANNEL_NAME_PREFIX = "com.pichillilorenzo/flutter_inappwebview_pull_to_refresh_" + var plugin: SwiftFlutterPlugin? var channelDelegate: PullToRefreshChannelDelegate? var settings: PullToRefreshSettings? From 3b999a310e39ac2fcce46e8c782edaa11a5fba58 Mon Sep 17 00:00:00 2001 From: Michal Srutek Date: Wed, 20 Dec 2023 15:50:43 +0100 Subject: [PATCH 2/3] Additional findings --- .../Classes/InAppWebView/InAppWebView.swift | 51 +++++++++---------- .../Classes/InAppWebView/InAppWebView.swift | 33 ++++++------ 2 files changed, 41 insertions(+), 43 deletions(-) diff --git a/flutter_inappwebview_ios/ios/Classes/InAppWebView/InAppWebView.swift b/flutter_inappwebview_ios/ios/Classes/InAppWebView/InAppWebView.swift index 9d9f2cc6..1fe738a0 100755 --- a/flutter_inappwebview_ios/ios/Classes/InAppWebView/InAppWebView.swift +++ b/flutter_inappwebview_ios/ios/Classes/InAppWebView/InAppWebView.swift @@ -2190,17 +2190,16 @@ public class InAppWebView: WKWebView, UIScrollViewDelegate, WKUIDelegate, } struct IdentityAndTrust { - - var identityRef:SecIdentity - var trust:SecTrust - var certArray:AnyObject + var identityRef: SecIdentity + var trust: SecTrust + var certArray: AnyObject } - func extractIdentity(PKCS12Data:NSData, password: String) -> IdentityAndTrust? { - var identityAndTrust:IdentityAndTrust? - var securityError:OSStatus = errSecSuccess + func extractIdentity(PKCS12Data: NSData, password: String) -> IdentityAndTrust? { + var identityAndTrust: IdentityAndTrust? + var securityError: OSStatus = errSecSuccess - var importResult: CFArray? = nil + var importResult: CFArray? securityError = SecPKCS12Import( PKCS12Data as NSData, [kSecImportExportPassphrase as String: password] as NSDictionary, @@ -2208,24 +2207,24 @@ public class InAppWebView: WKWebView, UIScrollViewDelegate, WKUIDelegate, ) if securityError == errSecSuccess { - let certItems:CFArray = importResult! as CFArray; - let certItemsArray:Array = certItems as Array - let dict:AnyObject? = certItemsArray.first; - if let certEntry:Dictionary = dict as? Dictionary { + let certItems: CFArray = importResult! as CFArray + let certItemsArray: Array = certItems as Array + let dict: AnyObject? = certItemsArray.first + if let certEntry: Dictionary = dict as? Dictionary { // grab the identity - let identityPointer:AnyObject? = certEntry["identity"]; + let identityPointer: AnyObject? = certEntry["identity"] let secIdentityRef:SecIdentity = (identityPointer as! SecIdentity?)! // grab the trust - let trustPointer:AnyObject? = certEntry["trust"] + let trustPointer: AnyObject? = certEntry["trust"] let trustRef:SecTrust = trustPointer as! SecTrust // grab the cert - let chainPointer:AnyObject? = certEntry["chain"] + let chainPointer: AnyObject? = certEntry["chain"] identityAndTrust = IdentityAndTrust(identityRef: secIdentityRef, trust: trustRef, certArray: chainPointer!) } } else { print("Security Error: " + securityError.description) if #available(iOS 11.3, *) { - print(SecCopyErrorMessageString(securityError,nil) ?? "") + print(SecCopyErrorMessageString(securityError, nil) ?? "") } } return identityAndTrust @@ -2239,7 +2238,7 @@ public class InAppWebView: WKWebView, UIScrollViewDelegate, WKUIDelegate, alertController.addAction(UIAlertAction(title: okButton, style: UIAlertAction.Style.default) { _ in completionHandler()} - ); + ) guard let presentingViewController = inAppBrowserDelegate != nil ? inAppBrowserDelegate as? InAppBrowserWebViewController : window?.rootViewController else { completionHandler() @@ -2463,16 +2462,16 @@ public class InAppWebView: WKWebView, UIScrollViewDelegate, WKUIDelegate, let disableHorizontalScroll = settings?.disableHorizontalScroll ?? false if startedByUser { if disableVerticalScroll && disableHorizontalScroll { - scrollView.contentOffset = CGPoint(x: lastScrollX, y: lastScrollY); + scrollView.contentOffset = CGPoint(x: lastScrollX, y: lastScrollY) } else if disableVerticalScroll { if scrollView.contentOffset.y >= 0 || scrollView.contentOffset.y < 0 { - scrollView.contentOffset = CGPoint(x: scrollView.contentOffset.x, y: lastScrollY); + scrollView.contentOffset = CGPoint(x: scrollView.contentOffset.x, y: lastScrollY) } } else if disableHorizontalScroll { if scrollView.contentOffset.x >= 0 || scrollView.contentOffset.x < 0 { - scrollView.contentOffset = CGPoint(x: lastScrollX, y: scrollView.contentOffset.y); + scrollView.contentOffset = CGPoint(x: lastScrollX, y: scrollView.contentOffset.y) } } } @@ -2789,24 +2788,24 @@ public class InAppWebView: WKWebView, UIScrollViewDelegate, WKUIDelegate, switch (message.name) { case "consoleLog": messageLevel = 1 - break; + break case "consoleDebug": // on Android, console.debug is TIP messageLevel = 0 - break; + break case "consoleError": messageLevel = 3 - break; + break case "consoleInfo": // on Android, console.info is LOG messageLevel = 1 - break; + break case "consoleWarn": messageLevel = 2 - break; + break default: messageLevel = 1 - break; + break } let consoleMessage = body["message"] as? String ?? "" diff --git a/flutter_inappwebview_macos/macos/Classes/InAppWebView/InAppWebView.swift b/flutter_inappwebview_macos/macos/Classes/InAppWebView/InAppWebView.swift index 154dd55c..456a081b 100755 --- a/flutter_inappwebview_macos/macos/Classes/InAppWebView/InAppWebView.swift +++ b/flutter_inappwebview_macos/macos/Classes/InAppWebView/InAppWebView.swift @@ -1571,15 +1571,14 @@ public class InAppWebView: WKWebView, WKUIDelegate, } struct IdentityAndTrust { - - var identityRef:SecIdentity - var trust:SecTrust - var certArray:AnyObject + var identityRef: SecIdentity + var trust: SecTrust + var certArray: AnyObject } - func extractIdentity(PKCS12Data:NSData, password: String) -> IdentityAndTrust? { - var identityAndTrust:IdentityAndTrust? - var securityError:OSStatus = errSecSuccess + func extractIdentity(PKCS12Data: NSData, password: String) -> IdentityAndTrust? { + var identityAndTrust: IdentityAndTrust? + var securityError: OSStatus = errSecSuccess var importResult: CFArray? = nil securityError = SecPKCS12Import( @@ -1589,19 +1588,19 @@ public class InAppWebView: WKWebView, WKUIDelegate, ) if securityError == errSecSuccess { - let certItems:CFArray = importResult! as CFArray; - let certItemsArray:Array = certItems as Array - let dict:AnyObject? = certItemsArray.first; - if let certEntry:Dictionary = dict as? Dictionary { + let certItems: CFArray = importResult! as CFArray; + let certItemsArray: Array = certItems as Array + let dict: AnyObject? = certItemsArray.first; + if let certEntry: Dictionary = dict as? Dictionary { // grab the identity - let identityPointer:AnyObject? = certEntry["identity"]; - let secIdentityRef:SecIdentity = (identityPointer as! SecIdentity?)!; + let identityPointer: AnyObject? = certEntry["identity"] + let secIdentityRef:SecIdentity = (identityPointer as! SecIdentity?)! // grab the trust - let trustPointer:AnyObject? = certEntry["trust"]; - let trustRef:SecTrust = trustPointer as! SecTrust; + let trustPointer: AnyObject? = certEntry["trust"] + let trustRef:SecTrust = trustPointer as! SecTrust // grab the cert - let chainPointer:AnyObject? = certEntry["chain"]; - identityAndTrust = IdentityAndTrust(identityRef: secIdentityRef, trust: trustRef, certArray: chainPointer!); + let chainPointer: AnyObject? = certEntry["chain"] + identityAndTrust = IdentityAndTrust(identityRef: secIdentityRef, trust: trustRef, certArray: chainPointer!) } } else { print("Security Error: " + securityError.description) From 7077320f95c6ae371b8c4d533d366943f46b59c4 Mon Sep 17 00:00:00 2001 From: Michal Srutek Date: Thu, 21 Dec 2023 08:07:57 +0100 Subject: [PATCH 3/3] Consistent colon spacing --- .../FindInteractionSettings.swift | 2 +- .../HeadlessWebViewChannelDelegate.swift | 2 +- .../InAppBrowserChannelDelegate.swift | 2 +- .../InAppWebView/CustomSchemeHandler.swift | 4 +-- .../WebMessage/WebMessageChannel.swift | 2 +- .../WebMessageChannelChannelDelegate.swift | 2 +- .../WebMessage/WebMessageListener.swift | 2 +- .../WebMessageListenerChannelDelegate.swift | 2 +- .../InAppWebView/WebViewChannelDelegate.swift | 30 +++++++++---------- .../PrintJob/CustomUIPrintPageRenderer.swift | 2 +- .../Classes/PrintJob/PrintAttributes.swift | 2 +- .../PrintJob/PrintJobChannelDelegate.swift | 2 +- .../Classes/PrintJob/PrintJobController.swift | 2 +- .../ios/Classes/PrintJob/PrintJobInfo.swift | 2 +- .../PullToRefreshChannelDelegate.swift | 2 +- .../PullToRefresh/PullToRefreshSettings.swift | 2 +- .../CustomUIActivity.swift | 2 +- .../SafariViewControllerChannelDelegate.swift | 2 +- .../Classes/Types/BaseCallbackResult.swift | 2 +- .../ios/Classes/Types/CallbackResult.swift | 2 +- .../ios/Classes/Types/ChannelDelegate.swift | 2 +- .../Classes/Types/ClientCertResponse.swift | 2 +- .../Classes/Types/CreateWindowAction.swift | 2 +- .../Classes/Types/CustomSchemeResponse.swift | 2 +- .../ios/Classes/Types/HttpAuthResponse.swift | 2 +- .../Classes/Types/PermissionResponse.swift | 2 +- .../ios/Classes/Types/PluginScript.swift | 2 +- .../Types/ServerTrustAuthResponse.swift | 2 +- .../ios/Classes/Types/Size2D.swift | 2 +- .../ios/Classes/Types/UserScript.swift | 2 +- .../ios/Classes/Types/WebMessage.swift | 2 +- .../ios/Classes/Types/WebMessagePort.swift | 2 +- .../WebAuthenticationSession.swift | 2 +- ...AuthenticationSessionChannelDelegate.swift | 2 +- .../FindInteractionChannelDelegate.swift | 2 +- .../FindInteractionController.swift | 2 +- .../FindInteractionSettings.swift | 2 +- .../HeadlessInAppWebView.swift | 2 +- .../HeadlessWebViewChannelDelegate.swift | 2 +- .../InAppBrowserChannelDelegate.swift | 2 +- .../InAppBrowser/InAppBrowserWindow.swift | 2 +- .../InAppWebView/CustomSchemeHandler.swift | 4 +-- .../WebMessage/WebMessageChannel.swift | 2 +- .../WebMessageChannelChannelDelegate.swift | 2 +- .../WebMessage/WebMessageListener.swift | 2 +- .../WebMessageListenerChannelDelegate.swift | 2 +- .../InAppWebView/WebViewChannelDelegate.swift | 30 +++++++++---------- .../PrintJob/CustomUIPrintPageRenderer.swift | 2 +- .../Classes/PrintJob/PrintAttributes.swift | 2 +- .../PrintJob/PrintJobChannelDelegate.swift | 2 +- .../Classes/PrintJob/PrintJobController.swift | 2 +- .../macos/Classes/PrintJob/PrintJobInfo.swift | 2 +- .../Classes/Types/BaseCallbackResult.swift | 2 +- .../macos/Classes/Types/CallbackResult.swift | 2 +- .../macos/Classes/Types/ChannelDelegate.swift | 2 +- .../Classes/Types/ClientCertResponse.swift | 2 +- .../Classes/Types/CreateWindowAction.swift | 2 +- .../Classes/Types/CustomSchemeResponse.swift | 2 +- .../Classes/Types/HttpAuthResponse.swift | 2 +- .../Classes/Types/PermissionResponse.swift | 2 +- .../macos/Classes/Types/PluginScript.swift | 2 +- .../Types/ServerTrustAuthResponse.swift | 2 +- .../macos/Classes/Types/Size2D.swift | 2 +- .../macos/Classes/Types/UserScript.swift | 2 +- .../macos/Classes/Types/WebMessage.swift | 2 +- .../macos/Classes/Types/WebMessagePort.swift | 2 +- .../WebAuthenticationSession.swift | 2 +- ...AuthenticationSessionChannelDelegate.swift | 2 +- 68 files changed, 98 insertions(+), 98 deletions(-) diff --git a/flutter_inappwebview_ios/ios/Classes/FindInteraction/FindInteractionSettings.swift b/flutter_inappwebview_ios/ios/Classes/FindInteraction/FindInteractionSettings.swift index 1c34c5bd..3c4ecb14 100644 --- a/flutter_inappwebview_ios/ios/Classes/FindInteraction/FindInteractionSettings.swift +++ b/flutter_inappwebview_ios/ios/Classes/FindInteraction/FindInteractionSettings.swift @@ -7,7 +7,7 @@ import Foundation -public class FindInteractionSettings : ISettings { +public class FindInteractionSettings: ISettings { override init(){ super.init() diff --git a/flutter_inappwebview_ios/ios/Classes/HeadlessInAppWebView/HeadlessWebViewChannelDelegate.swift b/flutter_inappwebview_ios/ios/Classes/HeadlessInAppWebView/HeadlessWebViewChannelDelegate.swift index 0b686da8..23e12a46 100644 --- a/flutter_inappwebview_ios/ios/Classes/HeadlessInAppWebView/HeadlessWebViewChannelDelegate.swift +++ b/flutter_inappwebview_ios/ios/Classes/HeadlessInAppWebView/HeadlessWebViewChannelDelegate.swift @@ -7,7 +7,7 @@ import Foundation -public class HeadlessWebViewChannelDelegate : ChannelDelegate { +public class HeadlessWebViewChannelDelegate: ChannelDelegate { private weak var headlessWebView: HeadlessInAppWebView? public init(headlessWebView: HeadlessInAppWebView, channel: FlutterMethodChannel) { diff --git a/flutter_inappwebview_ios/ios/Classes/InAppBrowser/InAppBrowserChannelDelegate.swift b/flutter_inappwebview_ios/ios/Classes/InAppBrowser/InAppBrowserChannelDelegate.swift index f97075c4..01d66ed8 100644 --- a/flutter_inappwebview_ios/ios/Classes/InAppBrowser/InAppBrowserChannelDelegate.swift +++ b/flutter_inappwebview_ios/ios/Classes/InAppBrowser/InAppBrowserChannelDelegate.swift @@ -7,7 +7,7 @@ import Foundation -public class InAppBrowserChannelDelegate : ChannelDelegate { +public class InAppBrowserChannelDelegate: ChannelDelegate { public override init(channel: FlutterMethodChannel) { super.init(channel: channel) } diff --git a/flutter_inappwebview_ios/ios/Classes/InAppWebView/CustomSchemeHandler.swift b/flutter_inappwebview_ios/ios/Classes/InAppWebView/CustomSchemeHandler.swift index a1c3fdc7..1dd22923 100755 --- a/flutter_inappwebview_ios/ios/Classes/InAppWebView/CustomSchemeHandler.swift +++ b/flutter_inappwebview_ios/ios/Classes/InAppWebView/CustomSchemeHandler.swift @@ -10,8 +10,8 @@ import Foundation import WebKit @available(iOS 11.0, *) -public class CustomSchemeHandler : NSObject, WKURLSchemeHandler { - var schemeHandlers: [Int:WKURLSchemeTask] = [:] +public class CustomSchemeHandler: NSObject, WKURLSchemeHandler { + var schemeHandlers: [Int: WKURLSchemeTask] = [:] public func webView(_ webView: WKWebView, start urlSchemeTask: WKURLSchemeTask) { schemeHandlers[urlSchemeTask.hash] = urlSchemeTask diff --git a/flutter_inappwebview_ios/ios/Classes/InAppWebView/WebMessage/WebMessageChannel.swift b/flutter_inappwebview_ios/ios/Classes/InAppWebView/WebMessage/WebMessageChannel.swift index 96e918e2..8e7b3784 100644 --- a/flutter_inappwebview_ios/ios/Classes/InAppWebView/WebMessage/WebMessageChannel.swift +++ b/flutter_inappwebview_ios/ios/Classes/InAppWebView/WebMessage/WebMessageChannel.swift @@ -7,7 +7,7 @@ import Foundation -public class WebMessageChannel : FlutterMethodCallDelegate { +public class WebMessageChannel: FlutterMethodCallDelegate { static var METHOD_CHANNEL_NAME_PREFIX = "com.pichillilorenzo/flutter_inappwebview_web_message_channel_" var id: String var plugin: SwiftFlutterPlugin? diff --git a/flutter_inappwebview_ios/ios/Classes/InAppWebView/WebMessage/WebMessageChannelChannelDelegate.swift b/flutter_inappwebview_ios/ios/Classes/InAppWebView/WebMessage/WebMessageChannelChannelDelegate.swift index c95e9a28..3f431567 100644 --- a/flutter_inappwebview_ios/ios/Classes/InAppWebView/WebMessage/WebMessageChannelChannelDelegate.swift +++ b/flutter_inappwebview_ios/ios/Classes/InAppWebView/WebMessage/WebMessageChannelChannelDelegate.swift @@ -7,7 +7,7 @@ import Foundation -public class WebMessageChannelChannelDelegate : ChannelDelegate { +public class WebMessageChannelChannelDelegate: ChannelDelegate { private weak var webMessageChannel: WebMessageChannel? public init(webMessageChannel: WebMessageChannel, channel: FlutterMethodChannel) { diff --git a/flutter_inappwebview_ios/ios/Classes/InAppWebView/WebMessage/WebMessageListener.swift b/flutter_inappwebview_ios/ios/Classes/InAppWebView/WebMessage/WebMessageListener.swift index 3b80930b..e902aedb 100644 --- a/flutter_inappwebview_ios/ios/Classes/InAppWebView/WebMessage/WebMessageListener.swift +++ b/flutter_inappwebview_ios/ios/Classes/InAppWebView/WebMessage/WebMessageListener.swift @@ -8,7 +8,7 @@ import Foundation import WebKit -public class WebMessageListener : FlutterMethodCallDelegate { +public class WebMessageListener: FlutterMethodCallDelegate { static var METHOD_CHANNEL_NAME_PREFIX = "com.pichillilorenzo/flutter_inappwebview_web_message_listener_" var id: String var jsObjectName: String diff --git a/flutter_inappwebview_ios/ios/Classes/InAppWebView/WebMessage/WebMessageListenerChannelDelegate.swift b/flutter_inappwebview_ios/ios/Classes/InAppWebView/WebMessage/WebMessageListenerChannelDelegate.swift index 085a2282..365a3d1a 100644 --- a/flutter_inappwebview_ios/ios/Classes/InAppWebView/WebMessage/WebMessageListenerChannelDelegate.swift +++ b/flutter_inappwebview_ios/ios/Classes/InAppWebView/WebMessage/WebMessageListenerChannelDelegate.swift @@ -7,7 +7,7 @@ import Foundation -public class WebMessageListenerChannelDelegate : ChannelDelegate { +public class WebMessageListenerChannelDelegate: ChannelDelegate { private weak var webMessageListener: WebMessageListener? public init(webMessageListener: WebMessageListener, channel: FlutterMethodChannel) { diff --git a/flutter_inappwebview_ios/ios/Classes/InAppWebView/WebViewChannelDelegate.swift b/flutter_inappwebview_ios/ios/Classes/InAppWebView/WebViewChannelDelegate.swift index 880810f5..58d95ca6 100644 --- a/flutter_inappwebview_ios/ios/Classes/InAppWebView/WebViewChannelDelegate.swift +++ b/flutter_inappwebview_ios/ios/Classes/InAppWebView/WebViewChannelDelegate.swift @@ -8,7 +8,7 @@ import Foundation import WebKit -public class WebViewChannelDelegate : ChannelDelegate { +public class WebViewChannelDelegate: ChannelDelegate { private weak var webView: InAppWebView? public init(webView: InAppWebView, channel: FlutterMethodChannel) { @@ -743,7 +743,7 @@ public class WebViewChannelDelegate : ChannelDelegate { channel?.invokeMethod("onExitFullscreen", arguments: arguments) } - public class JsAlertCallback : BaseCallbackResult { + public class JsAlertCallback: BaseCallbackResult { override init() { super.init() self.decodeResult = { (obj: Any?) in @@ -769,7 +769,7 @@ public class WebViewChannelDelegate : ChannelDelegate { channel?.invokeMethod("onJsAlert", arguments: arguments, callback: callback) } - public class JsConfirmCallback : BaseCallbackResult { + public class JsConfirmCallback: BaseCallbackResult { override init() { super.init() self.decodeResult = { (obj: Any?) in @@ -795,7 +795,7 @@ public class WebViewChannelDelegate : ChannelDelegate { channel?.invokeMethod("onJsConfirm", arguments: arguments, callback: callback) } - public class JsPromptCallback : BaseCallbackResult { + public class JsPromptCallback: BaseCallbackResult { override init() { super.init() self.decodeResult = { (obj: Any?) in @@ -822,7 +822,7 @@ public class WebViewChannelDelegate : ChannelDelegate { channel?.invokeMethod("onJsPrompt", arguments: arguments, callback: callback) } - public class CreateWindowCallback : BaseCallbackResult { + public class CreateWindowCallback: BaseCallbackResult { override init() { super.init() self.decodeResult = { (obj: Any?) in @@ -866,7 +866,7 @@ public class WebViewChannelDelegate : ChannelDelegate { channel?.invokeMethod("onTitleChanged", arguments: arguments) } - public class PermissionRequestCallback : BaseCallbackResult { + public class PermissionRequestCallback: BaseCallbackResult { override init() { super.init() self.decodeResult = { (obj: Any?) in @@ -887,7 +887,7 @@ public class WebViewChannelDelegate : ChannelDelegate { channel?.invokeMethod("onPermissionRequest", arguments: request.toMap(), callback: callback) } - public class ShouldOverrideUrlLoadingCallback : BaseCallbackResult { + public class ShouldOverrideUrlLoadingCallback: BaseCallbackResult { override init() { super.init() self.decodeResult = { (obj: Any?) in @@ -945,7 +945,7 @@ public class WebViewChannelDelegate : ChannelDelegate { channel?.invokeMethod("onReceivedHttpError", arguments: arguments) } - public class ReceivedHttpAuthRequestCallback : BaseCallbackResult { + public class ReceivedHttpAuthRequestCallback: BaseCallbackResult { override init() { super.init() self.decodeResult = { (obj: Any?) in @@ -977,7 +977,7 @@ public class WebViewChannelDelegate : ChannelDelegate { } } - public class ReceivedServerTrustAuthRequestCallback : BaseCallbackResult { + public class ReceivedServerTrustAuthRequestCallback: BaseCallbackResult { override init() { super.init() self.decodeResult = { (obj: Any?) in @@ -1009,7 +1009,7 @@ public class WebViewChannelDelegate : ChannelDelegate { } } - public class ReceivedClientCertRequestCallback : BaseCallbackResult { + public class ReceivedClientCertRequestCallback: BaseCallbackResult { override init() { super.init() self.decodeResult = { (obj: Any?) in @@ -1056,7 +1056,7 @@ public class WebViewChannelDelegate : ChannelDelegate { channel?.invokeMethod("onPageCommitVisible", arguments: arguments) } - public class LoadResourceWithCustomSchemeCallback : BaseCallbackResult { + public class LoadResourceWithCustomSchemeCallback: BaseCallbackResult { override init() { super.init() self.decodeResult = { (obj: Any?) in @@ -1074,7 +1074,7 @@ public class WebViewChannelDelegate : ChannelDelegate { channel?.invokeMethod("onLoadResourceWithCustomScheme", arguments: arguments, callback: callback) } - public class CallJsHandlerCallback : BaseCallbackResult { + public class CallJsHandlerCallback: BaseCallbackResult { override init() { super.init() self.decodeResult = { (obj: Any?) in @@ -1095,7 +1095,7 @@ public class WebViewChannelDelegate : ChannelDelegate { channel?.invokeMethod("onCallJsHandler", arguments: arguments, callback: callback) } - public class NavigationResponseCallback : BaseCallbackResult { + public class NavigationResponseCallback: BaseCallbackResult { override init() { super.init() self.decodeResult = { (obj: Any?) in @@ -1119,7 +1119,7 @@ public class WebViewChannelDelegate : ChannelDelegate { channel?.invokeMethod("onNavigationResponse", arguments: navigationResponse.toMap(), callback: callback) } - public class ShouldAllowDeprecatedTLSCallback : BaseCallbackResult { + public class ShouldAllowDeprecatedTLSCallback: BaseCallbackResult { override init() { super.init() self.decodeResult = { (obj: Any?) in @@ -1182,7 +1182,7 @@ public class WebViewChannelDelegate : ChannelDelegate { channel?.invokeMethod("onMicrophoneCaptureStateChanged", arguments: arguments) } - public class PrintRequestCallback : BaseCallbackResult { + public class PrintRequestCallback: BaseCallbackResult { override init() { super.init() self.decodeResult = { (obj: Any?) in diff --git a/flutter_inappwebview_ios/ios/Classes/PrintJob/CustomUIPrintPageRenderer.swift b/flutter_inappwebview_ios/ios/Classes/PrintJob/CustomUIPrintPageRenderer.swift index ae1a32ee..4b003e56 100644 --- a/flutter_inappwebview_ios/ios/Classes/PrintJob/CustomUIPrintPageRenderer.swift +++ b/flutter_inappwebview_ios/ios/Classes/PrintJob/CustomUIPrintPageRenderer.swift @@ -7,7 +7,7 @@ import Foundation -public class CustomUIPrintPageRenderer : UIPrintPageRenderer { +public class CustomUIPrintPageRenderer: UIPrintPageRenderer { private var _numberOfPages: Int? private var forceRenderingQuality: Int? diff --git a/flutter_inappwebview_ios/ios/Classes/PrintJob/PrintAttributes.swift b/flutter_inappwebview_ios/ios/Classes/PrintJob/PrintAttributes.swift index 4c0b15ce..ddd20d58 100644 --- a/flutter_inappwebview_ios/ios/Classes/PrintJob/PrintAttributes.swift +++ b/flutter_inappwebview_ios/ios/Classes/PrintJob/PrintAttributes.swift @@ -7,7 +7,7 @@ import Foundation -public class PrintAttributes : NSObject { +public class PrintAttributes: NSObject { var orientation: UIPrintInfo.Orientation? var duplex: UIPrintInfo.Duplex? var outputType: UIPrintInfo.OutputType? diff --git a/flutter_inappwebview_ios/ios/Classes/PrintJob/PrintJobChannelDelegate.swift b/flutter_inappwebview_ios/ios/Classes/PrintJob/PrintJobChannelDelegate.swift index 7063bd81..337fae3a 100644 --- a/flutter_inappwebview_ios/ios/Classes/PrintJob/PrintJobChannelDelegate.swift +++ b/flutter_inappwebview_ios/ios/Classes/PrintJob/PrintJobChannelDelegate.swift @@ -7,7 +7,7 @@ import Foundation -public class PrintJobChannelDelegate : ChannelDelegate { +public class PrintJobChannelDelegate: ChannelDelegate { private weak var printJobController: PrintJobController? public init(printJobController: PrintJobController, channel: FlutterMethodChannel) { diff --git a/flutter_inappwebview_ios/ios/Classes/PrintJob/PrintJobController.swift b/flutter_inappwebview_ios/ios/Classes/PrintJob/PrintJobController.swift index 8ac450f5..6b4c3210 100644 --- a/flutter_inappwebview_ios/ios/Classes/PrintJob/PrintJobController.swift +++ b/flutter_inappwebview_ios/ios/Classes/PrintJob/PrintJobController.swift @@ -15,7 +15,7 @@ public enum PrintJobState: Int { case canceled = 7 } -public class PrintJobController : NSObject, Disposable, UIPrintInteractionControllerDelegate { +public class PrintJobController: NSObject, Disposable, UIPrintInteractionControllerDelegate { static let METHOD_CHANNEL_NAME_PREFIX = "com.pichillilorenzo/flutter_inappwebview_printjobcontroller_" var id: String var plugin: SwiftFlutterPlugin? diff --git a/flutter_inappwebview_ios/ios/Classes/PrintJob/PrintJobInfo.swift b/flutter_inappwebview_ios/ios/Classes/PrintJob/PrintJobInfo.swift index 84a00261..b94c1293 100644 --- a/flutter_inappwebview_ios/ios/Classes/PrintJob/PrintJobInfo.swift +++ b/flutter_inappwebview_ios/ios/Classes/PrintJob/PrintJobInfo.swift @@ -7,7 +7,7 @@ import Foundation -public class PrintJobInfo : NSObject { +public class PrintJobInfo: NSObject { var state: PrintJobState var attributes: PrintAttributes var creationTime: Int64 diff --git a/flutter_inappwebview_ios/ios/Classes/PullToRefresh/PullToRefreshChannelDelegate.swift b/flutter_inappwebview_ios/ios/Classes/PullToRefresh/PullToRefreshChannelDelegate.swift index 89bbcba4..30490831 100644 --- a/flutter_inappwebview_ios/ios/Classes/PullToRefresh/PullToRefreshChannelDelegate.swift +++ b/flutter_inappwebview_ios/ios/Classes/PullToRefresh/PullToRefreshChannelDelegate.swift @@ -7,7 +7,7 @@ import Foundation -public class PullToRefreshChannelDelegate : ChannelDelegate { +public class PullToRefreshChannelDelegate: ChannelDelegate { private weak var pullToRefreshControl: PullToRefreshControl? public init(pullToRefreshControl: PullToRefreshControl, channel: FlutterMethodChannel) { diff --git a/flutter_inappwebview_ios/ios/Classes/PullToRefresh/PullToRefreshSettings.swift b/flutter_inappwebview_ios/ios/Classes/PullToRefresh/PullToRefreshSettings.swift index f241c59d..2172bba1 100644 --- a/flutter_inappwebview_ios/ios/Classes/PullToRefresh/PullToRefreshSettings.swift +++ b/flutter_inappwebview_ios/ios/Classes/PullToRefresh/PullToRefreshSettings.swift @@ -7,7 +7,7 @@ import Foundation -public class PullToRefreshSettings : ISettings { +public class PullToRefreshSettings: ISettings { var enabled = true var color: String? diff --git a/flutter_inappwebview_ios/ios/Classes/SafariViewController/CustomUIActivity.swift b/flutter_inappwebview_ios/ios/Classes/SafariViewController/CustomUIActivity.swift index cd3ecfa0..540a1265 100644 --- a/flutter_inappwebview_ios/ios/Classes/SafariViewController/CustomUIActivity.swift +++ b/flutter_inappwebview_ios/ios/Classes/SafariViewController/CustomUIActivity.swift @@ -7,7 +7,7 @@ import Foundation -class CustomUIActivity : UIActivity { +class CustomUIActivity: UIActivity { var plugin: SwiftFlutterPlugin var viewId: String var id: Int64 diff --git a/flutter_inappwebview_ios/ios/Classes/SafariViewController/SafariViewControllerChannelDelegate.swift b/flutter_inappwebview_ios/ios/Classes/SafariViewController/SafariViewControllerChannelDelegate.swift index c7fc5adb..ba5d99b5 100644 --- a/flutter_inappwebview_ios/ios/Classes/SafariViewController/SafariViewControllerChannelDelegate.swift +++ b/flutter_inappwebview_ios/ios/Classes/SafariViewController/SafariViewControllerChannelDelegate.swift @@ -7,7 +7,7 @@ import Foundation -public class SafariViewControllerChannelDelegate : ChannelDelegate { +public class SafariViewControllerChannelDelegate: ChannelDelegate { private weak var safariViewController: SafariViewController? public init(safariViewController: SafariViewController, channel: FlutterMethodChannel) { diff --git a/flutter_inappwebview_ios/ios/Classes/Types/BaseCallbackResult.swift b/flutter_inappwebview_ios/ios/Classes/Types/BaseCallbackResult.swift index a76caf72..aa79e499 100644 --- a/flutter_inappwebview_ios/ios/Classes/Types/BaseCallbackResult.swift +++ b/flutter_inappwebview_ios/ios/Classes/Types/BaseCallbackResult.swift @@ -7,7 +7,7 @@ import Foundation -public class BaseCallbackResult : CallbackResult { +public class BaseCallbackResult: CallbackResult { override init() { super.init() diff --git a/flutter_inappwebview_ios/ios/Classes/Types/CallbackResult.swift b/flutter_inappwebview_ios/ios/Classes/Types/CallbackResult.swift index 5b0ba2b5..ea677c6b 100644 --- a/flutter_inappwebview_ios/ios/Classes/Types/CallbackResult.swift +++ b/flutter_inappwebview_ios/ios/Classes/Types/CallbackResult.swift @@ -7,7 +7,7 @@ import Foundation -public class CallbackResult : MethodChannelResult { +public class CallbackResult: MethodChannelResult { public var notImplemented: () -> Void = {} public var success: (Any?) -> Void = {_ in } public var error: (String, String?, Any?) -> Void = {_,_,_ in } diff --git a/flutter_inappwebview_ios/ios/Classes/Types/ChannelDelegate.swift b/flutter_inappwebview_ios/ios/Classes/Types/ChannelDelegate.swift index c451b4b9..40511fb3 100644 --- a/flutter_inappwebview_ios/ios/Classes/Types/ChannelDelegate.swift +++ b/flutter_inappwebview_ios/ios/Classes/Types/ChannelDelegate.swift @@ -7,7 +7,7 @@ import Foundation -public class ChannelDelegate : FlutterMethodCallDelegate, Disposable { +public class ChannelDelegate: FlutterMethodCallDelegate, Disposable { var channel: FlutterMethodChannel? public init(channel: FlutterMethodChannel) { diff --git a/flutter_inappwebview_ios/ios/Classes/Types/ClientCertResponse.swift b/flutter_inappwebview_ios/ios/Classes/Types/ClientCertResponse.swift index 75ae6818..6273db74 100644 --- a/flutter_inappwebview_ios/ios/Classes/Types/ClientCertResponse.swift +++ b/flutter_inappwebview_ios/ios/Classes/Types/ClientCertResponse.swift @@ -7,7 +7,7 @@ import Foundation -public class ClientCertResponse : NSObject { +public class ClientCertResponse: NSObject { var certificatePath: String var certificatePassword: String? var keyStoreType: String? diff --git a/flutter_inappwebview_ios/ios/Classes/Types/CreateWindowAction.swift b/flutter_inappwebview_ios/ios/Classes/Types/CreateWindowAction.swift index db7f7658..f3b4681f 100644 --- a/flutter_inappwebview_ios/ios/Classes/Types/CreateWindowAction.swift +++ b/flutter_inappwebview_ios/ios/Classes/Types/CreateWindowAction.swift @@ -8,7 +8,7 @@ import Foundation import WebKit -public class CreateWindowAction : NSObject { +public class CreateWindowAction: NSObject { var navigationAction: WKNavigationAction var windowId: Int64 var windowFeatures: WKWindowFeatures diff --git a/flutter_inappwebview_ios/ios/Classes/Types/CustomSchemeResponse.swift b/flutter_inappwebview_ios/ios/Classes/Types/CustomSchemeResponse.swift index eaf3380b..c7ad4a75 100644 --- a/flutter_inappwebview_ios/ios/Classes/Types/CustomSchemeResponse.swift +++ b/flutter_inappwebview_ios/ios/Classes/Types/CustomSchemeResponse.swift @@ -7,7 +7,7 @@ import Foundation -public class CustomSchemeResponse : NSObject { +public class CustomSchemeResponse: NSObject { var data: Data var contentType: String var contentEncoding: String diff --git a/flutter_inappwebview_ios/ios/Classes/Types/HttpAuthResponse.swift b/flutter_inappwebview_ios/ios/Classes/Types/HttpAuthResponse.swift index f2f85d64..f77d3ab1 100644 --- a/flutter_inappwebview_ios/ios/Classes/Types/HttpAuthResponse.swift +++ b/flutter_inappwebview_ios/ios/Classes/Types/HttpAuthResponse.swift @@ -7,7 +7,7 @@ import Foundation -public class HttpAuthResponse : NSObject { +public class HttpAuthResponse: NSObject { var username: String var password: String var permanentPersistence: Bool diff --git a/flutter_inappwebview_ios/ios/Classes/Types/PermissionResponse.swift b/flutter_inappwebview_ios/ios/Classes/Types/PermissionResponse.swift index 7971f95e..171817bb 100644 --- a/flutter_inappwebview_ios/ios/Classes/Types/PermissionResponse.swift +++ b/flutter_inappwebview_ios/ios/Classes/Types/PermissionResponse.swift @@ -7,7 +7,7 @@ import Foundation -public class PermissionResponse : NSObject { +public class PermissionResponse: NSObject { var resources: [Any] var action: Int? diff --git a/flutter_inappwebview_ios/ios/Classes/Types/PluginScript.swift b/flutter_inappwebview_ios/ios/Classes/Types/PluginScript.swift index 913137e0..9b6499f2 100644 --- a/flutter_inappwebview_ios/ios/Classes/Types/PluginScript.swift +++ b/flutter_inappwebview_ios/ios/Classes/Types/PluginScript.swift @@ -8,7 +8,7 @@ import Foundation import WebKit -public class PluginScript : UserScript { +public class PluginScript: UserScript { var requiredInAllContentWorlds = false var messageHandlerNames: [String] = [] diff --git a/flutter_inappwebview_ios/ios/Classes/Types/ServerTrustAuthResponse.swift b/flutter_inappwebview_ios/ios/Classes/Types/ServerTrustAuthResponse.swift index d78fb07c..2a998057 100644 --- a/flutter_inappwebview_ios/ios/Classes/Types/ServerTrustAuthResponse.swift +++ b/flutter_inappwebview_ios/ios/Classes/Types/ServerTrustAuthResponse.swift @@ -7,7 +7,7 @@ import Foundation -public class ServerTrustAuthResponse : NSObject { +public class ServerTrustAuthResponse: NSObject { var action: Int? public init(action: Int? = nil) { diff --git a/flutter_inappwebview_ios/ios/Classes/Types/Size2D.swift b/flutter_inappwebview_ios/ios/Classes/Types/Size2D.swift index 7c2b9c6c..de13ffc2 100644 --- a/flutter_inappwebview_ios/ios/Classes/Types/Size2D.swift +++ b/flutter_inappwebview_ios/ios/Classes/Types/Size2D.swift @@ -7,7 +7,7 @@ import Foundation -public class Size2D : NSObject { +public class Size2D: NSObject { var width: Double var height: Double diff --git a/flutter_inappwebview_ios/ios/Classes/Types/UserScript.swift b/flutter_inappwebview_ios/ios/Classes/Types/UserScript.swift index ae5f7ea0..e18c588d 100644 --- a/flutter_inappwebview_ios/ios/Classes/Types/UserScript.swift +++ b/flutter_inappwebview_ios/ios/Classes/Types/UserScript.swift @@ -8,7 +8,7 @@ import Foundation import WebKit -public class UserScript : WKUserScript { +public class UserScript: WKUserScript { var groupName: String? private var contentWorldWrapper: Any? diff --git a/flutter_inappwebview_ios/ios/Classes/Types/WebMessage.swift b/flutter_inappwebview_ios/ios/Classes/Types/WebMessage.swift index fca86ca6..5a49f611 100644 --- a/flutter_inappwebview_ios/ios/Classes/Types/WebMessage.swift +++ b/flutter_inappwebview_ios/ios/Classes/Types/WebMessage.swift @@ -7,7 +7,7 @@ import Foundation -public class WebMessage : NSObject, Disposable { +public class WebMessage: NSObject, Disposable { var data: Any? var type: WebMessageType var ports: [WebMessagePort]? diff --git a/flutter_inappwebview_ios/ios/Classes/Types/WebMessagePort.swift b/flutter_inappwebview_ios/ios/Classes/Types/WebMessagePort.swift index 824e9e4c..b7a6e53c 100644 --- a/flutter_inappwebview_ios/ios/Classes/Types/WebMessagePort.swift +++ b/flutter_inappwebview_ios/ios/Classes/Types/WebMessagePort.swift @@ -7,7 +7,7 @@ import Foundation -public class WebMessagePort : NSObject { +public class WebMessagePort: NSObject { var name: String var index: Int64 var webMessageChannelId: String diff --git a/flutter_inappwebview_ios/ios/Classes/WebAuthenticationSession/WebAuthenticationSession.swift b/flutter_inappwebview_ios/ios/Classes/WebAuthenticationSession/WebAuthenticationSession.swift index 281abbbf..99409b11 100644 --- a/flutter_inappwebview_ios/ios/Classes/WebAuthenticationSession/WebAuthenticationSession.swift +++ b/flutter_inappwebview_ios/ios/Classes/WebAuthenticationSession/WebAuthenticationSession.swift @@ -9,7 +9,7 @@ import Foundation import AuthenticationServices import SafariServices -public class WebAuthenticationSession : NSObject, ASWebAuthenticationPresentationContextProviding, Disposable { +public class WebAuthenticationSession: NSObject, ASWebAuthenticationPresentationContextProviding, Disposable { static let METHOD_CHANNEL_NAME_PREFIX = "com.pichillilorenzo/flutter_webauthenticationsession_" var id: String var plugin: SwiftFlutterPlugin? diff --git a/flutter_inappwebview_ios/ios/Classes/WebAuthenticationSession/WebAuthenticationSessionChannelDelegate.swift b/flutter_inappwebview_ios/ios/Classes/WebAuthenticationSession/WebAuthenticationSessionChannelDelegate.swift index ef517bc6..5bbc023a 100644 --- a/flutter_inappwebview_ios/ios/Classes/WebAuthenticationSession/WebAuthenticationSessionChannelDelegate.swift +++ b/flutter_inappwebview_ios/ios/Classes/WebAuthenticationSession/WebAuthenticationSessionChannelDelegate.swift @@ -7,7 +7,7 @@ import Foundation -public class WebAuthenticationSessionChannelDelegate : ChannelDelegate { +public class WebAuthenticationSessionChannelDelegate: ChannelDelegate { private weak var webAuthenticationSession: WebAuthenticationSession? public init(webAuthenticationSession: WebAuthenticationSession, channel: FlutterMethodChannel) { diff --git a/flutter_inappwebview_macos/macos/Classes/FindInteraction/FindInteractionChannelDelegate.swift b/flutter_inappwebview_macos/macos/Classes/FindInteraction/FindInteractionChannelDelegate.swift index fe1ab455..e471d286 100644 --- a/flutter_inappwebview_macos/macos/Classes/FindInteraction/FindInteractionChannelDelegate.swift +++ b/flutter_inappwebview_macos/macos/Classes/FindInteraction/FindInteractionChannelDelegate.swift @@ -8,7 +8,7 @@ import Foundation import FlutterMacOS -public class FindInteractionChannelDelegate : ChannelDelegate { +public class FindInteractionChannelDelegate: ChannelDelegate { private weak var findInteractionController: FindInteractionController? public init(findInteractionController: FindInteractionController, channel: FlutterMethodChannel) { diff --git a/flutter_inappwebview_macos/macos/Classes/FindInteraction/FindInteractionController.swift b/flutter_inappwebview_macos/macos/Classes/FindInteraction/FindInteractionController.swift index 2b5f7c97..68bcae59 100644 --- a/flutter_inappwebview_macos/macos/Classes/FindInteraction/FindInteractionController.swift +++ b/flutter_inappwebview_macos/macos/Classes/FindInteraction/FindInteractionController.swift @@ -8,7 +8,7 @@ import Foundation import FlutterMacOS -public class FindInteractionController : NSObject, Disposable { +public class FindInteractionController: NSObject, Disposable { static var METHOD_CHANNEL_NAME_PREFIX = "com.pichillilorenzo/flutter_inappwebview_find_interaction_"; var plugin: InAppWebViewFlutterPlugin? diff --git a/flutter_inappwebview_macos/macos/Classes/FindInteraction/FindInteractionSettings.swift b/flutter_inappwebview_macos/macos/Classes/FindInteraction/FindInteractionSettings.swift index 1c34c5bd..3c4ecb14 100644 --- a/flutter_inappwebview_macos/macos/Classes/FindInteraction/FindInteractionSettings.swift +++ b/flutter_inappwebview_macos/macos/Classes/FindInteraction/FindInteractionSettings.swift @@ -7,7 +7,7 @@ import Foundation -public class FindInteractionSettings : ISettings { +public class FindInteractionSettings: ISettings { override init(){ super.init() diff --git a/flutter_inappwebview_macos/macos/Classes/HeadlessInAppWebView/HeadlessInAppWebView.swift b/flutter_inappwebview_macos/macos/Classes/HeadlessInAppWebView/HeadlessInAppWebView.swift index cfc36a1a..b95222fb 100644 --- a/flutter_inappwebview_macos/macos/Classes/HeadlessInAppWebView/HeadlessInAppWebView.swift +++ b/flutter_inappwebview_macos/macos/Classes/HeadlessInAppWebView/HeadlessInAppWebView.swift @@ -8,7 +8,7 @@ import Foundation import FlutterMacOS -public class HeadlessInAppWebView : Disposable { +public class HeadlessInAppWebView: Disposable { static let METHOD_CHANNEL_NAME_PREFIX = "com.pichillilorenzo/flutter_headless_inappwebview_" var id: String var channelDelegate: HeadlessWebViewChannelDelegate? diff --git a/flutter_inappwebview_macos/macos/Classes/HeadlessInAppWebView/HeadlessWebViewChannelDelegate.swift b/flutter_inappwebview_macos/macos/Classes/HeadlessInAppWebView/HeadlessWebViewChannelDelegate.swift index 1e6dc9c7..9b4ee63e 100644 --- a/flutter_inappwebview_macos/macos/Classes/HeadlessInAppWebView/HeadlessWebViewChannelDelegate.swift +++ b/flutter_inappwebview_macos/macos/Classes/HeadlessInAppWebView/HeadlessWebViewChannelDelegate.swift @@ -8,7 +8,7 @@ import Foundation import FlutterMacOS -public class HeadlessWebViewChannelDelegate : ChannelDelegate { +public class HeadlessWebViewChannelDelegate: ChannelDelegate { private weak var headlessWebView: HeadlessInAppWebView? public init(headlessWebView: HeadlessInAppWebView, channel: FlutterMethodChannel) { diff --git a/flutter_inappwebview_macos/macos/Classes/InAppBrowser/InAppBrowserChannelDelegate.swift b/flutter_inappwebview_macos/macos/Classes/InAppBrowser/InAppBrowserChannelDelegate.swift index f9728882..19dc499f 100644 --- a/flutter_inappwebview_macos/macos/Classes/InAppBrowser/InAppBrowserChannelDelegate.swift +++ b/flutter_inappwebview_macos/macos/Classes/InAppBrowser/InAppBrowserChannelDelegate.swift @@ -8,7 +8,7 @@ import Foundation import FlutterMacOS -public class InAppBrowserChannelDelegate : ChannelDelegate { +public class InAppBrowserChannelDelegate: ChannelDelegate { public override init(channel: FlutterMethodChannel) { super.init(channel: channel) } diff --git a/flutter_inappwebview_macos/macos/Classes/InAppBrowser/InAppBrowserWindow.swift b/flutter_inappwebview_macos/macos/Classes/InAppBrowser/InAppBrowserWindow.swift index 4347e393..72aaff20 100644 --- a/flutter_inappwebview_macos/macos/Classes/InAppBrowser/InAppBrowserWindow.swift +++ b/flutter_inappwebview_macos/macos/Classes/InAppBrowser/InAppBrowserWindow.swift @@ -15,7 +15,7 @@ struct ToolbarIdentifiers { static let menuButton = NSToolbarItem.Identifier(rawValue: "MenuButton") } -public class InAppBrowserWindow : NSWindow, NSWindowDelegate, NSToolbarDelegate, NSSearchFieldDelegate { +public class InAppBrowserWindow: NSWindow, NSWindowDelegate, NSToolbarDelegate, NSSearchFieldDelegate { var searchItem: NSToolbarItem? var backItem: NSToolbarItem? var forwardItem: NSToolbarItem? diff --git a/flutter_inappwebview_macos/macos/Classes/InAppWebView/CustomSchemeHandler.swift b/flutter_inappwebview_macos/macos/Classes/InAppWebView/CustomSchemeHandler.swift index 95400fb2..a8df969e 100755 --- a/flutter_inappwebview_macos/macos/Classes/InAppWebView/CustomSchemeHandler.swift +++ b/flutter_inappwebview_macos/macos/Classes/InAppWebView/CustomSchemeHandler.swift @@ -10,8 +10,8 @@ import Foundation import WebKit @available(macOS 10.13, *) -public class CustomSchemeHandler : NSObject, WKURLSchemeHandler { - var schemeHandlers: [Int:WKURLSchemeTask] = [:] +public class CustomSchemeHandler: NSObject, WKURLSchemeHandler { + var schemeHandlers: [Int: WKURLSchemeTask] = [:] public func webView(_ webView: WKWebView, start urlSchemeTask: WKURLSchemeTask) { schemeHandlers[urlSchemeTask.hash] = urlSchemeTask diff --git a/flutter_inappwebview_macos/macos/Classes/InAppWebView/WebMessage/WebMessageChannel.swift b/flutter_inappwebview_macos/macos/Classes/InAppWebView/WebMessage/WebMessageChannel.swift index b5e2c88d..c806e0de 100644 --- a/flutter_inappwebview_macos/macos/Classes/InAppWebView/WebMessage/WebMessageChannel.swift +++ b/flutter_inappwebview_macos/macos/Classes/InAppWebView/WebMessage/WebMessageChannel.swift @@ -8,7 +8,7 @@ import Foundation import FlutterMacOS -public class WebMessageChannel : FlutterMethodCallDelegate { +public class WebMessageChannel: FlutterMethodCallDelegate { static var METHOD_CHANNEL_NAME_PREFIX = "com.pichillilorenzo/flutter_inappwebview_web_message_channel_" var id: String var plugin: InAppWebViewFlutterPlugin? diff --git a/flutter_inappwebview_macos/macos/Classes/InAppWebView/WebMessage/WebMessageChannelChannelDelegate.swift b/flutter_inappwebview_macos/macos/Classes/InAppWebView/WebMessage/WebMessageChannelChannelDelegate.swift index 22049da7..462141c5 100644 --- a/flutter_inappwebview_macos/macos/Classes/InAppWebView/WebMessage/WebMessageChannelChannelDelegate.swift +++ b/flutter_inappwebview_macos/macos/Classes/InAppWebView/WebMessage/WebMessageChannelChannelDelegate.swift @@ -8,7 +8,7 @@ import Foundation import FlutterMacOS -public class WebMessageChannelChannelDelegate : ChannelDelegate { +public class WebMessageChannelChannelDelegate: ChannelDelegate { private weak var webMessageChannel: WebMessageChannel? public init(webMessageChannel: WebMessageChannel, channel: FlutterMethodChannel) { diff --git a/flutter_inappwebview_macos/macos/Classes/InAppWebView/WebMessage/WebMessageListener.swift b/flutter_inappwebview_macos/macos/Classes/InAppWebView/WebMessage/WebMessageListener.swift index bd1c0860..270f01d3 100644 --- a/flutter_inappwebview_macos/macos/Classes/InAppWebView/WebMessage/WebMessageListener.swift +++ b/flutter_inappwebview_macos/macos/Classes/InAppWebView/WebMessage/WebMessageListener.swift @@ -9,7 +9,7 @@ import Foundation import WebKit import FlutterMacOS -public class WebMessageListener : FlutterMethodCallDelegate { +public class WebMessageListener: FlutterMethodCallDelegate { static var METHOD_CHANNEL_NAME_PREFIX = "com.pichillilorenzo/flutter_inappwebview_web_message_listener_" var id: String var jsObjectName: String diff --git a/flutter_inappwebview_macos/macos/Classes/InAppWebView/WebMessage/WebMessageListenerChannelDelegate.swift b/flutter_inappwebview_macos/macos/Classes/InAppWebView/WebMessage/WebMessageListenerChannelDelegate.swift index 198f36a4..39304dae 100644 --- a/flutter_inappwebview_macos/macos/Classes/InAppWebView/WebMessage/WebMessageListenerChannelDelegate.swift +++ b/flutter_inappwebview_macos/macos/Classes/InAppWebView/WebMessage/WebMessageListenerChannelDelegate.swift @@ -8,7 +8,7 @@ import Foundation import FlutterMacOS -public class WebMessageListenerChannelDelegate : ChannelDelegate { +public class WebMessageListenerChannelDelegate: ChannelDelegate { private weak var webMessageListener: WebMessageListener? public init(webMessageListener: WebMessageListener, channel: FlutterMethodChannel) { diff --git a/flutter_inappwebview_macos/macos/Classes/InAppWebView/WebViewChannelDelegate.swift b/flutter_inappwebview_macos/macos/Classes/InAppWebView/WebViewChannelDelegate.swift index b75c7046..9eb906e5 100644 --- a/flutter_inappwebview_macos/macos/Classes/InAppWebView/WebViewChannelDelegate.swift +++ b/flutter_inappwebview_macos/macos/Classes/InAppWebView/WebViewChannelDelegate.swift @@ -9,7 +9,7 @@ import Foundation import WebKit import FlutterMacOS -public class WebViewChannelDelegate : ChannelDelegate { +public class WebViewChannelDelegate: ChannelDelegate { private weak var webView: InAppWebView? public init(webView: InAppWebView, channel: FlutterMethodChannel) { @@ -718,7 +718,7 @@ public class WebViewChannelDelegate : ChannelDelegate { channel?.invokeMethod("onExitFullscreen", arguments: arguments) } - public class JsAlertCallback : BaseCallbackResult { + public class JsAlertCallback: BaseCallbackResult { override init() { super.init() self.decodeResult = { (obj: Any?) in @@ -740,7 +740,7 @@ public class WebViewChannelDelegate : ChannelDelegate { channel?.invokeMethod("onJsAlert", arguments: arguments, callback: callback) } - public class JsConfirmCallback : BaseCallbackResult { + public class JsConfirmCallback: BaseCallbackResult { override init() { super.init() self.decodeResult = { (obj: Any?) in @@ -762,7 +762,7 @@ public class WebViewChannelDelegate : ChannelDelegate { channel?.invokeMethod("onJsConfirm", arguments: arguments, callback: callback) } - public class JsPromptCallback : BaseCallbackResult { + public class JsPromptCallback: BaseCallbackResult { override init() { super.init() self.decodeResult = { (obj: Any?) in @@ -785,7 +785,7 @@ public class WebViewChannelDelegate : ChannelDelegate { channel?.invokeMethod("onJsPrompt", arguments: arguments, callback: callback) } - public class CreateWindowCallback : BaseCallbackResult { + public class CreateWindowCallback: BaseCallbackResult { override init() { super.init() self.decodeResult = { (obj: Any?) in @@ -829,7 +829,7 @@ public class WebViewChannelDelegate : ChannelDelegate { channel?.invokeMethod("onTitleChanged", arguments: arguments) } - public class PermissionRequestCallback : BaseCallbackResult { + public class PermissionRequestCallback: BaseCallbackResult { override init() { super.init() self.decodeResult = { (obj: Any?) in @@ -850,7 +850,7 @@ public class WebViewChannelDelegate : ChannelDelegate { channel?.invokeMethod("onPermissionRequest", arguments: request.toMap(), callback: callback) } - public class ShouldOverrideUrlLoadingCallback : BaseCallbackResult { + public class ShouldOverrideUrlLoadingCallback: BaseCallbackResult { override init() { super.init() self.decodeResult = { (obj: Any?) in @@ -908,7 +908,7 @@ public class WebViewChannelDelegate : ChannelDelegate { channel?.invokeMethod("onReceivedHttpError", arguments: arguments) } - public class ReceivedHttpAuthRequestCallback : BaseCallbackResult { + public class ReceivedHttpAuthRequestCallback: BaseCallbackResult { override init() { super.init() self.decodeResult = { (obj: Any?) in @@ -940,7 +940,7 @@ public class WebViewChannelDelegate : ChannelDelegate { } } - public class ReceivedServerTrustAuthRequestCallback : BaseCallbackResult { + public class ReceivedServerTrustAuthRequestCallback: BaseCallbackResult { override init() { super.init() self.decodeResult = { (obj: Any?) in @@ -972,7 +972,7 @@ public class WebViewChannelDelegate : ChannelDelegate { } } - public class ReceivedClientCertRequestCallback : BaseCallbackResult { + public class ReceivedClientCertRequestCallback: BaseCallbackResult { override init() { super.init() self.decodeResult = { (obj: Any?) in @@ -1019,7 +1019,7 @@ public class WebViewChannelDelegate : ChannelDelegate { channel?.invokeMethod("onPageCommitVisible", arguments: arguments) } - public class LoadResourceWithCustomSchemeCallback : BaseCallbackResult { + public class LoadResourceWithCustomSchemeCallback: BaseCallbackResult { override init() { super.init() self.decodeResult = { (obj: Any?) in @@ -1037,7 +1037,7 @@ public class WebViewChannelDelegate : ChannelDelegate { channel?.invokeMethod("onLoadResourceWithCustomScheme", arguments: arguments, callback: callback) } - public class CallJsHandlerCallback : BaseCallbackResult { + public class CallJsHandlerCallback: BaseCallbackResult { override init() { super.init() self.decodeResult = { (obj: Any?) in @@ -1058,7 +1058,7 @@ public class WebViewChannelDelegate : ChannelDelegate { channel?.invokeMethod("onCallJsHandler", arguments: arguments, callback: callback) } - public class NavigationResponseCallback : BaseCallbackResult { + public class NavigationResponseCallback: BaseCallbackResult { override init() { super.init() self.decodeResult = { (obj: Any?) in @@ -1082,7 +1082,7 @@ public class WebViewChannelDelegate : ChannelDelegate { channel?.invokeMethod("onNavigationResponse", arguments: navigationResponse.toMap(), callback: callback) } - public class ShouldAllowDeprecatedTLSCallback : BaseCallbackResult { + public class ShouldAllowDeprecatedTLSCallback: BaseCallbackResult { override init() { super.init() self.decodeResult = { (obj: Any?) in @@ -1145,7 +1145,7 @@ public class WebViewChannelDelegate : ChannelDelegate { channel?.invokeMethod("onMicrophoneCaptureStateChanged", arguments: arguments) } - public class PrintRequestCallback : BaseCallbackResult { + public class PrintRequestCallback: BaseCallbackResult { override init() { super.init() self.decodeResult = { (obj: Any?) in diff --git a/flutter_inappwebview_macos/macos/Classes/PrintJob/CustomUIPrintPageRenderer.swift b/flutter_inappwebview_macos/macos/Classes/PrintJob/CustomUIPrintPageRenderer.swift index c1976a15..214ad7de 100644 --- a/flutter_inappwebview_macos/macos/Classes/PrintJob/CustomUIPrintPageRenderer.swift +++ b/flutter_inappwebview_macos/macos/Classes/PrintJob/CustomUIPrintPageRenderer.swift @@ -7,7 +7,7 @@ import Foundation // -//public class CustomUIPrintPageRenderer : UIPrintPageRenderer { +//public class CustomUIPrintPageRenderer: UIPrintPageRenderer { // private var _numberOfPages: Int? // private var forceRenderingQuality: Int? // diff --git a/flutter_inappwebview_macos/macos/Classes/PrintJob/PrintAttributes.swift b/flutter_inappwebview_macos/macos/Classes/PrintJob/PrintAttributes.swift index c6cfdd6b..50b3d69c 100644 --- a/flutter_inappwebview_macos/macos/Classes/PrintJob/PrintAttributes.swift +++ b/flutter_inappwebview_macos/macos/Classes/PrintJob/PrintAttributes.swift @@ -7,7 +7,7 @@ import Foundation -public class PrintAttributes : NSObject { +public class PrintAttributes: NSObject { var orientation: NSPrintInfo.PaperOrientation? var margins: NSEdgeInsets? var paperRect: CGRect? diff --git a/flutter_inappwebview_macos/macos/Classes/PrintJob/PrintJobChannelDelegate.swift b/flutter_inappwebview_macos/macos/Classes/PrintJob/PrintJobChannelDelegate.swift index 4c8dcd48..7514dd4f 100644 --- a/flutter_inappwebview_macos/macos/Classes/PrintJob/PrintJobChannelDelegate.swift +++ b/flutter_inappwebview_macos/macos/Classes/PrintJob/PrintJobChannelDelegate.swift @@ -8,7 +8,7 @@ import Foundation import FlutterMacOS -public class PrintJobChannelDelegate : ChannelDelegate { +public class PrintJobChannelDelegate: ChannelDelegate { private weak var printJobController: PrintJobController? public init(printJobController: PrintJobController, channel: FlutterMethodChannel) { diff --git a/flutter_inappwebview_macos/macos/Classes/PrintJob/PrintJobController.swift b/flutter_inappwebview_macos/macos/Classes/PrintJob/PrintJobController.swift index 67e18c22..9b76a408 100644 --- a/flutter_inappwebview_macos/macos/Classes/PrintJob/PrintJobController.swift +++ b/flutter_inappwebview_macos/macos/Classes/PrintJob/PrintJobController.swift @@ -15,7 +15,7 @@ public enum PrintJobState: Int { case canceled = 7 } -public class PrintJobController : NSObject, Disposable { +public class PrintJobController: NSObject, Disposable { static let METHOD_CHANNEL_NAME_PREFIX = "com.pichillilorenzo/flutter_inappwebview_printjobcontroller_" var id: String var plugin: InAppWebViewFlutterPlugin? diff --git a/flutter_inappwebview_macos/macos/Classes/PrintJob/PrintJobInfo.swift b/flutter_inappwebview_macos/macos/Classes/PrintJob/PrintJobInfo.swift index d522558a..eac04ac6 100644 --- a/flutter_inappwebview_macos/macos/Classes/PrintJob/PrintJobInfo.swift +++ b/flutter_inappwebview_macos/macos/Classes/PrintJob/PrintJobInfo.swift @@ -7,7 +7,7 @@ import Foundation -public class PrintJobInfo : NSObject { +public class PrintJobInfo: NSObject { var state: PrintJobState var attributes: PrintAttributes var creationTime: Int64 diff --git a/flutter_inappwebview_macos/macos/Classes/Types/BaseCallbackResult.swift b/flutter_inappwebview_macos/macos/Classes/Types/BaseCallbackResult.swift index a76caf72..aa79e499 100644 --- a/flutter_inappwebview_macos/macos/Classes/Types/BaseCallbackResult.swift +++ b/flutter_inappwebview_macos/macos/Classes/Types/BaseCallbackResult.swift @@ -7,7 +7,7 @@ import Foundation -public class BaseCallbackResult : CallbackResult { +public class BaseCallbackResult: CallbackResult { override init() { super.init() diff --git a/flutter_inappwebview_macos/macos/Classes/Types/CallbackResult.swift b/flutter_inappwebview_macos/macos/Classes/Types/CallbackResult.swift index 628082c0..083d6880 100644 --- a/flutter_inappwebview_macos/macos/Classes/Types/CallbackResult.swift +++ b/flutter_inappwebview_macos/macos/Classes/Types/CallbackResult.swift @@ -7,7 +7,7 @@ import Foundation -public class CallbackResult : MethodChannelResult { +public class CallbackResult: MethodChannelResult { public var notImplemented: () -> Void = {} public var success: (Any?) -> Void = {_ in } public var error: (String, String?, Any?) -> Void = {_,_,_ in } diff --git a/flutter_inappwebview_macos/macos/Classes/Types/ChannelDelegate.swift b/flutter_inappwebview_macos/macos/Classes/Types/ChannelDelegate.swift index b8e7030f..e56474f8 100644 --- a/flutter_inappwebview_macos/macos/Classes/Types/ChannelDelegate.swift +++ b/flutter_inappwebview_macos/macos/Classes/Types/ChannelDelegate.swift @@ -8,7 +8,7 @@ import Foundation import FlutterMacOS -public class ChannelDelegate : FlutterMethodCallDelegate, Disposable { +public class ChannelDelegate: FlutterMethodCallDelegate, Disposable { var channel: FlutterMethodChannel? public init(channel: FlutterMethodChannel) { diff --git a/flutter_inappwebview_macos/macos/Classes/Types/ClientCertResponse.swift b/flutter_inappwebview_macos/macos/Classes/Types/ClientCertResponse.swift index 75ae6818..6273db74 100644 --- a/flutter_inappwebview_macos/macos/Classes/Types/ClientCertResponse.swift +++ b/flutter_inappwebview_macos/macos/Classes/Types/ClientCertResponse.swift @@ -7,7 +7,7 @@ import Foundation -public class ClientCertResponse : NSObject { +public class ClientCertResponse: NSObject { var certificatePath: String var certificatePassword: String? var keyStoreType: String? diff --git a/flutter_inappwebview_macos/macos/Classes/Types/CreateWindowAction.swift b/flutter_inappwebview_macos/macos/Classes/Types/CreateWindowAction.swift index db7f7658..f3b4681f 100644 --- a/flutter_inappwebview_macos/macos/Classes/Types/CreateWindowAction.swift +++ b/flutter_inappwebview_macos/macos/Classes/Types/CreateWindowAction.swift @@ -8,7 +8,7 @@ import Foundation import WebKit -public class CreateWindowAction : NSObject { +public class CreateWindowAction: NSObject { var navigationAction: WKNavigationAction var windowId: Int64 var windowFeatures: WKWindowFeatures diff --git a/flutter_inappwebview_macos/macos/Classes/Types/CustomSchemeResponse.swift b/flutter_inappwebview_macos/macos/Classes/Types/CustomSchemeResponse.swift index ba5f0c60..53836c94 100644 --- a/flutter_inappwebview_macos/macos/Classes/Types/CustomSchemeResponse.swift +++ b/flutter_inappwebview_macos/macos/Classes/Types/CustomSchemeResponse.swift @@ -8,7 +8,7 @@ import Foundation import FlutterMacOS -public class CustomSchemeResponse : NSObject { +public class CustomSchemeResponse: NSObject { var data: Data var contentType: String var contentEncoding: String diff --git a/flutter_inappwebview_macos/macos/Classes/Types/HttpAuthResponse.swift b/flutter_inappwebview_macos/macos/Classes/Types/HttpAuthResponse.swift index f2f85d64..f77d3ab1 100644 --- a/flutter_inappwebview_macos/macos/Classes/Types/HttpAuthResponse.swift +++ b/flutter_inappwebview_macos/macos/Classes/Types/HttpAuthResponse.swift @@ -7,7 +7,7 @@ import Foundation -public class HttpAuthResponse : NSObject { +public class HttpAuthResponse: NSObject { var username: String var password: String var permanentPersistence: Bool diff --git a/flutter_inappwebview_macos/macos/Classes/Types/PermissionResponse.swift b/flutter_inappwebview_macos/macos/Classes/Types/PermissionResponse.swift index 7971f95e..171817bb 100644 --- a/flutter_inappwebview_macos/macos/Classes/Types/PermissionResponse.swift +++ b/flutter_inappwebview_macos/macos/Classes/Types/PermissionResponse.swift @@ -7,7 +7,7 @@ import Foundation -public class PermissionResponse : NSObject { +public class PermissionResponse: NSObject { var resources: [Any] var action: Int? diff --git a/flutter_inappwebview_macos/macos/Classes/Types/PluginScript.swift b/flutter_inappwebview_macos/macos/Classes/Types/PluginScript.swift index a9c9f37d..7218099b 100644 --- a/flutter_inappwebview_macos/macos/Classes/Types/PluginScript.swift +++ b/flutter_inappwebview_macos/macos/Classes/Types/PluginScript.swift @@ -8,7 +8,7 @@ import Foundation import WebKit -public class PluginScript : UserScript { +public class PluginScript: UserScript { var requiredInAllContentWorlds = false var messageHandlerNames: [String] = [] diff --git a/flutter_inappwebview_macos/macos/Classes/Types/ServerTrustAuthResponse.swift b/flutter_inappwebview_macos/macos/Classes/Types/ServerTrustAuthResponse.swift index d78fb07c..2a998057 100644 --- a/flutter_inappwebview_macos/macos/Classes/Types/ServerTrustAuthResponse.swift +++ b/flutter_inappwebview_macos/macos/Classes/Types/ServerTrustAuthResponse.swift @@ -7,7 +7,7 @@ import Foundation -public class ServerTrustAuthResponse : NSObject { +public class ServerTrustAuthResponse: NSObject { var action: Int? public init(action: Int? = nil) { diff --git a/flutter_inappwebview_macos/macos/Classes/Types/Size2D.swift b/flutter_inappwebview_macos/macos/Classes/Types/Size2D.swift index 7c2b9c6c..de13ffc2 100644 --- a/flutter_inappwebview_macos/macos/Classes/Types/Size2D.swift +++ b/flutter_inappwebview_macos/macos/Classes/Types/Size2D.swift @@ -7,7 +7,7 @@ import Foundation -public class Size2D : NSObject { +public class Size2D: NSObject { var width: Double var height: Double diff --git a/flutter_inappwebview_macos/macos/Classes/Types/UserScript.swift b/flutter_inappwebview_macos/macos/Classes/Types/UserScript.swift index 63f30576..d350836e 100644 --- a/flutter_inappwebview_macos/macos/Classes/Types/UserScript.swift +++ b/flutter_inappwebview_macos/macos/Classes/Types/UserScript.swift @@ -8,7 +8,7 @@ import Foundation import WebKit -public class UserScript : WKUserScript { +public class UserScript: WKUserScript { var groupName: String? private var contentWorldWrapper: Any? diff --git a/flutter_inappwebview_macos/macos/Classes/Types/WebMessage.swift b/flutter_inappwebview_macos/macos/Classes/Types/WebMessage.swift index 8b958b80..634c7edc 100644 --- a/flutter_inappwebview_macos/macos/Classes/Types/WebMessage.swift +++ b/flutter_inappwebview_macos/macos/Classes/Types/WebMessage.swift @@ -8,7 +8,7 @@ import Foundation import FlutterMacOS -public class WebMessage : NSObject, Disposable { +public class WebMessage: NSObject, Disposable { var data: Any? var type: WebMessageType var ports: [WebMessagePort]? diff --git a/flutter_inappwebview_macos/macos/Classes/Types/WebMessagePort.swift b/flutter_inappwebview_macos/macos/Classes/Types/WebMessagePort.swift index 824e9e4c..b7a6e53c 100644 --- a/flutter_inappwebview_macos/macos/Classes/Types/WebMessagePort.swift +++ b/flutter_inappwebview_macos/macos/Classes/Types/WebMessagePort.swift @@ -7,7 +7,7 @@ import Foundation -public class WebMessagePort : NSObject { +public class WebMessagePort: NSObject { var name: String var index: Int64 var webMessageChannelId: String diff --git a/flutter_inappwebview_macos/macos/Classes/WebAuthenticationSession/WebAuthenticationSession.swift b/flutter_inappwebview_macos/macos/Classes/WebAuthenticationSession/WebAuthenticationSession.swift index a477d42d..92140fe1 100644 --- a/flutter_inappwebview_macos/macos/Classes/WebAuthenticationSession/WebAuthenticationSession.swift +++ b/flutter_inappwebview_macos/macos/Classes/WebAuthenticationSession/WebAuthenticationSession.swift @@ -10,7 +10,7 @@ import AuthenticationServices import SafariServices import FlutterMacOS -public class WebAuthenticationSession : NSObject, ASWebAuthenticationPresentationContextProviding, Disposable { +public class WebAuthenticationSession: NSObject, ASWebAuthenticationPresentationContextProviding, Disposable { static let METHOD_CHANNEL_NAME_PREFIX = "com.pichillilorenzo/flutter_webauthenticationsession_" var id: String var plugin: InAppWebViewFlutterPlugin? diff --git a/flutter_inappwebview_macos/macos/Classes/WebAuthenticationSession/WebAuthenticationSessionChannelDelegate.swift b/flutter_inappwebview_macos/macos/Classes/WebAuthenticationSession/WebAuthenticationSessionChannelDelegate.swift index 6cdf5dbe..ddd8d528 100644 --- a/flutter_inappwebview_macos/macos/Classes/WebAuthenticationSession/WebAuthenticationSessionChannelDelegate.swift +++ b/flutter_inappwebview_macos/macos/Classes/WebAuthenticationSession/WebAuthenticationSessionChannelDelegate.swift @@ -8,7 +8,7 @@ import Foundation import FlutterMacOS -public class WebAuthenticationSessionChannelDelegate : ChannelDelegate { +public class WebAuthenticationSessionChannelDelegate: ChannelDelegate { private weak var webAuthenticationSession: WebAuthenticationSession? public init(webAuthenticationSession: WebAuthenticationSession, channel: FlutterMethodChannel) {