This PR fixes two crashes when enableWebKit is true (which was the default) on iOS 9.x. The first one when the WebView component was mounted (fixes issue #150) and the second one, when the component was unmounted (fixes issue #213). The first problem happen when the RNCWKWebView.m was loaded: The programming guide for WebKit (version 2006) ([pdf](http://mirror.informatimago.com/next/developer.apple.com/documentation/Cocoa/Conceptual/DisplayWebContent/WebKit_DisplayWebContent.pdf)) from Apple said, that it is (was) required to check if the 'new' WebKit Framework was available. This was required when the WebKit framework was only available on Mac OS X (10.2) when the Safari was installed. 😆 Because WebKit is (currently..) a fix part of iOS we didn't need this check this anymore to determinate if WebKit is available. I also see no other reference that this is required in iOS so I just remove this code. Without this code the WebView works also on iOS 9.x. The second issue happen when the WKWebView was removed from the native view hierarchy. Its required (only on iOS 9) to remove the UIScrollView delegate before cleaning up the webview. Its possible to try this PR with: ``` npm install --save "react-native-webview@jerolimov/react-native-webview#fix-ios9-crash" # or yarn add "react-native-webview@jerolimov/react-native-webview#fix-ios9-crash" ``` If you use CocoaPods, you should also update your Pods with ``` cd ios && pod update && cd .. ```
|
|
||
43 |
|
43 |
|
44 |
|
44 |
|
45 |
|
45 |
|
46 |
|
|
|
47 |
|
|
|
48 |
|
|
|
49 |
|
|
|
50 |
|
|
|
51 |
|
|
|
52 |
|
|
|
53 |
|
|
|
54 |
|
|
|
55 |
|
|
|
56 |
|
|
|
57 |
|
|
|
58 |
|
|
|
59 |
|
|
|
60 |
|
|
|
61 |
|
|
|
62 |
|
|
|
63 |
|
|
|
64 |
|
|
|
65 |
|
|
|
66 |
|
46 |
|
67 |
|
47 |
|
68 |
|
48 |
|
|
|
||
91 |
|
71 |
|
92 |
|
72 |
|
93 |
|
73 |
|
|
74 |
|
|
|
75 |
|
|
|
76 |
|
|
|
77 |
|
|
|
78 |
|
|
94 |
|
79 |
|
95 |
|
80 |
|
96 |
|
81 |
|
|
|
||
105 |
|
90 |
|
106 |
|
91 |
|
107 |
|
92 |
|
108 |
|
|
|
109 |
|
|
|
110 |
|
|
|
111 |
|
|
|
112 |
|
93 |
|
113 |
|
94 |
|
114 |
|
95 |
|
|
|
||
186 |
|
167 |
|
187 |
|
168 |
|
188 |
|
169 |
|
|
170 |
|
|
189 |
|
171 |
|
190 |
|
172 |
|
191 |
|
173 |
|