diff --git a/flutter_inappwebview_ios/ios/Classes/InAppBrowser/InAppBrowserWebViewController.swift b/flutter_inappwebview_ios/ios/Classes/InAppBrowser/InAppBrowserWebViewController.swift index 3960e922..a642463b 100755 --- a/flutter_inappwebview_ios/ios/Classes/InAppBrowser/InAppBrowserWebViewController.swift +++ b/flutter_inappwebview_ios/ios/Classes/InAppBrowser/InAppBrowserWebViewController.swift @@ -153,7 +153,7 @@ public class InAppBrowserWebViewController: UIViewController, InAppBrowserDelega if let contentBlockers = webView?.settings?.contentBlockers, contentBlockers.count > 0 { do { let jsonData = try JSONSerialization.data(withJSONObject: contentBlockers, options: []) - let blockRules = String(data: jsonData, encoding: String.Encoding.utf8) + let blockRules = String(data: jsonData, encoding: .utf8) WKContentRuleListStore.default().compileContentRuleList( forIdentifier: "ContentBlockingRules", encodedContentRuleList: blockRules) { (contentRuleList, error) in diff --git a/flutter_inappwebview_ios/ios/Classes/InAppWebView/FlutterWebViewController.swift b/flutter_inappwebview_ios/ios/Classes/InAppWebView/FlutterWebViewController.swift index 2348c078..3be8d5bc 100755 --- a/flutter_inappwebview_ios/ios/Classes/InAppWebView/FlutterWebViewController.swift +++ b/flutter_inappwebview_ios/ios/Classes/InAppWebView/FlutterWebViewController.swift @@ -115,7 +115,7 @@ public class FlutterWebViewController: NSObject, FlutterPlatformView, Disposable if let contentBlockers = webView.settings?.contentBlockers, contentBlockers.count > 0 { do { let jsonData = try JSONSerialization.data(withJSONObject: contentBlockers, options: []) - let blockRules = String(data: jsonData, encoding: String.Encoding.utf8) + let blockRules = String(data: jsonData, encoding: .utf8) WKContentRuleListStore.default().compileContentRuleList( forIdentifier: "ContentBlockingRules", encodedContentRuleList: blockRules) { (contentRuleList, error) in diff --git a/flutter_inappwebview_ios/ios/Classes/InAppWebView/InAppWebView.swift b/flutter_inappwebview_ios/ios/Classes/InAppWebView/InAppWebView.swift index c4390995..d2fd04ac 100755 --- a/flutter_inappwebview_ios/ios/Classes/InAppWebView/InAppWebView.swift +++ b/flutter_inappwebview_ios/ios/Classes/InAppWebView/InAppWebView.swift @@ -1250,7 +1250,7 @@ public class InAppWebView: WKWebView, UIScrollViewDelegate, WKUIDelegate, if contentBlockers.count > 0 { do { let jsonData = try JSONSerialization.data(withJSONObject: contentBlockers, options: []) - let blockRules = String(data: jsonData, encoding: String.Encoding.utf8) + let blockRules = String(data: jsonData, encoding: .utf8) WKContentRuleListStore.default().compileContentRuleList( forIdentifier: "ContentBlockingRules", encodedContentRuleList: blockRules) { (contentRuleList, error) in @@ -1368,7 +1368,7 @@ public class InAppWebView: WKWebView, UIScrollViewDelegate, WKUIDelegate, var jsToInject = source if let wrapper = jsWrapper { let jsonData: Data? = try? JSONSerialization.data(withJSONObject: [source], options: []) - let sourceArrayString = String(data: jsonData!, encoding: String.Encoding.utf8) + let sourceArrayString = String(data: jsonData!, encoding: .utf8) let sourceString: String? = (sourceArrayString! as NSString).substring(with: NSRange(location: 1, length: (sourceArrayString?.count ?? 0) - 2)) jsToInject = String(format: wrapper, sourceString!) } @@ -1400,7 +1400,7 @@ public class InAppWebView: WKWebView, UIScrollViewDelegate, WKUIDelegate, var jsToInject = source if let wrapper = jsWrapper { let jsonData: Data? = try? JSONSerialization.data(withJSONObject: [source], options: []) - let sourceArrayString = String(data: jsonData!, encoding: String.Encoding.utf8) + let sourceArrayString = String(data: jsonData!, encoding: .utf8) let sourceString: String? = (sourceArrayString! as NSString).substring(with: NSRange(location: 1, length: (sourceArrayString?.count ?? 0) - 2)) jsToInject = String(format: wrapper, sourceString!) } diff --git a/flutter_inappwebview_macos/macos/Classes/InAppBrowser/InAppBrowserWebViewController.swift b/flutter_inappwebview_macos/macos/Classes/InAppBrowser/InAppBrowserWebViewController.swift index 4daaaabe..631a3266 100755 --- a/flutter_inappwebview_macos/macos/Classes/InAppBrowser/InAppBrowserWebViewController.swift +++ b/flutter_inappwebview_macos/macos/Classes/InAppBrowser/InAppBrowserWebViewController.swift @@ -108,7 +108,7 @@ public class InAppBrowserWebViewController: NSViewController, InAppBrowserDelega if let contentBlockers = webView?.settings?.contentBlockers, contentBlockers.count > 0 { do { let jsonData = try JSONSerialization.data(withJSONObject: contentBlockers, options: []) - let blockRules = String(data: jsonData, encoding: String.Encoding.utf8) + let blockRules = String(data: jsonData, encoding: .utf8) WKContentRuleListStore.default().compileContentRuleList( forIdentifier: "ContentBlockingRules", encodedContentRuleList: blockRules) { (contentRuleList, error) in diff --git a/flutter_inappwebview_macos/macos/Classes/InAppWebView/FlutterWebViewController.swift b/flutter_inappwebview_macos/macos/Classes/InAppWebView/FlutterWebViewController.swift index 3e8e85c8..147b5c1a 100755 --- a/flutter_inappwebview_macos/macos/Classes/InAppWebView/FlutterWebViewController.swift +++ b/flutter_inappwebview_macos/macos/Classes/InAppWebView/FlutterWebViewController.swift @@ -104,7 +104,7 @@ public class FlutterWebViewController: NSObject, /*FlutterPlatformView,*/ Dispos if let contentBlockers = webView.settings?.contentBlockers, contentBlockers.count > 0 { do { let jsonData = try JSONSerialization.data(withJSONObject: contentBlockers, options: []) - let blockRules = String(data: jsonData, encoding: String.Encoding.utf8) + let blockRules = String(data: jsonData, encoding: .utf8) WKContentRuleListStore.default().compileContentRuleList( forIdentifier: "ContentBlockingRules", encodedContentRuleList: blockRules) { (contentRuleList, error) in diff --git a/flutter_inappwebview_macos/macos/Classes/InAppWebView/InAppWebView.swift b/flutter_inappwebview_macos/macos/Classes/InAppWebView/InAppWebView.swift index 154dd55c..d5f67b98 100755 --- a/flutter_inappwebview_macos/macos/Classes/InAppWebView/InAppWebView.swift +++ b/flutter_inappwebview_macos/macos/Classes/InAppWebView/InAppWebView.swift @@ -711,7 +711,7 @@ public class InAppWebView: WKWebView, WKUIDelegate, if contentBlockers.count > 0 { do { let jsonData = try JSONSerialization.data(withJSONObject: contentBlockers, options: []) - let blockRules = String(data: jsonData, encoding: String.Encoding.utf8) + let blockRules = String(data: jsonData, encoding: .utf8) WKContentRuleListStore.default().compileContentRuleList( forIdentifier: "ContentBlockingRules", encodedContentRuleList: blockRules) { (contentRuleList, error) in @@ -806,7 +806,7 @@ public class InAppWebView: WKWebView, WKUIDelegate, var jsToInject = source if let wrapper = jsWrapper { let jsonData: Data? = try? JSONSerialization.data(withJSONObject: [source], options: []) - let sourceArrayString = String(data: jsonData!, encoding: String.Encoding.utf8) + let sourceArrayString = String(data: jsonData!, encoding: .utf8) let sourceString: String? = (sourceArrayString! as NSString).substring(with: NSRange(location: 1, length: (sourceArrayString?.count ?? 0) - 2)) jsToInject = String(format: wrapper, sourceString!) } @@ -838,7 +838,7 @@ public class InAppWebView: WKWebView, WKUIDelegate, var jsToInject = source if let wrapper = jsWrapper { let jsonData: Data? = try? JSONSerialization.data(withJSONObject: [source], options: []) - let sourceArrayString = String(data: jsonData!, encoding: String.Encoding.utf8) + let sourceArrayString = String(data: jsonData!, encoding: .utf8) let sourceString: String? = (sourceArrayString! as NSString).substring(with: NSRange(location: 1, length: (sourceArrayString?.count ?? 0) - 2)) jsToInject = String(format: wrapper, sourceString!) }