-
Notifications
You must be signed in to change notification settings - Fork 9.7k
[webview_flutter_wkwebvew] Fix UIScrollView regression for inset behavior #6104
Conversation
cyanglaz
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
| FWFInstanceManager *instanceManager = [[FWFInstanceManager alloc] init]; | ||
| FWFWebViewHostApiImpl *hostAPI = [[FWFWebViewHostApiImpl alloc] | ||
| initWithBinaryMessenger:OCMProtocolMock(@protocol(FlutterBinaryMessenger)) | ||
| instanceManager:instanceManager]; | ||
|
|
||
| [instanceManager addDartCreatedInstance:[[WKWebViewConfiguration alloc] init] withIdentifier:0]; | ||
|
|
||
| FlutterError *error; | ||
| [hostAPI createWithIdentifier:@1 configurationIdentifier:@0 error:&error]; | ||
| FWFWebView *webView = (FWFWebView *)[instanceManager instanceForIdentifier:1]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nits: Should all of these wrapped inside if (@available(iOS 13, *)) so they don't run if below iOS 13?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good point. I updated the methods with their repspective API_AVAILABLE(ios(11.0))
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, I'll use that next time. I didn't know there were XCT methods for it. I would have assumed XCode would have recommend this solution.
It looks like these lines were missed when creating the new implementation:
plugins/packages/webview_flutter/webview_flutter_wkwebview/ios/Classes/FlutterWebView.m
Lines 128 to 133 in bdec9ba
This PR adds them to
FWFWebViewand adds the tests from the old implementation to verify these settings.Fixes: flutter/flutter#107639
Pre-launch Checklist
dart format.)[shared_preferences]pubspec.yamlwith an appropriate new version according to the pub versioning philosophy, or this PR is exempt from version changes.CHANGELOG.mdto add a description of the change, following repository CHANGELOG style.///).If you need help, consider asking for advice on the #hackers-new channel on Discord.