@@ -11,11 +11,6 @@ struct WebView: UIViewRepresentable {
11
11
@Binding var isLoading : Bool
12
12
@Binding var title : String ?
13
13
@Binding var error : Error ?
14
-
15
- private let WebKitErrorDomain = " WebKitErrorDomain "
16
- private enum WebKitErrorCode : Int {
17
- case pluginHandledLoad = 204
18
- }
19
14
20
15
func makeCoordinator( ) -> Coordinator {
21
16
Coordinator (
@@ -44,6 +39,11 @@ struct WebView: UIViewRepresentable {
44
39
var isLoading : Binding < Bool >
45
40
var title : Binding < String ? >
46
41
var error : Binding < Error ? >
42
+
43
+ private let WebKitErrorDomain = " WebKitErrorDomain "
44
+ private enum WebKitErrorCode : Int {
45
+ case pluginHandledLoad = 204
46
+ }
47
47
48
48
init (
49
49
webView: WebView ,
@@ -76,7 +76,6 @@ struct WebView: UIViewRepresentable {
76
76
didFailProvisionalNavigation navigation: WKNavigation ! ,
77
77
withError error: Error
78
78
) {
79
- // Ignore "Plug-in handled load" error as it's actually success for audio files
80
79
let nsError = error as NSError
81
80
if nsError. domain == WebKitErrorDomain && nsError. code == WebKitErrorCode . pluginHandledLoad. rawValue {
82
81
return
@@ -91,7 +90,6 @@ struct WebView: UIViewRepresentable {
91
90
didFail navigation: WKNavigation ! ,
92
91
withError error: Error
93
92
) {
94
- // Ignore "Plug-in handled load" error as it's actually success for audio files
95
93
let nsError = error as NSError
96
94
if nsError. domain == WebKitErrorDomain && nsError. code == WebKitErrorCode . pluginHandledLoad. rawValue {
97
95
return
0 commit comments