-
Notifications
You must be signed in to change notification settings - Fork 936
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Using WKWebView instead of UIWebView #54
Conversation
Removing commented code; Using withZoom and hidden values; Verifying WebView instance before "navigate", "evalJavascript", "resize" and "closeWebView".
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.
Thanks for your contribution 👍 , I added some comments
ios/Classes/FlutterWebviewPlugin.m
Outdated
if (withZoom != (id)[NSNull null] && [withZoom boolValue]) { | ||
self.webview.scalesPageToFit = YES; | ||
self.webview.scrollView.delegate = self; | ||
_enableZoom = [withZoom boolValue]; | ||
} | ||
|
||
if (hidden != (id)[NSNull null] && [hidden boolValue]) { |
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.
so can we remove the condition ?
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.
🤔 Yes! BOOL values are 0 by default in obj-c, so we don't need to check if it's nil
ios/Classes/FlutterWebviewPlugin.m
Outdated
self.webview = [[WKWebView alloc] initWithFrame:rc]; | ||
self.webview.navigationDelegate = self; | ||
[self.viewController.view addSubview:self.webview]; | ||
|
||
if (withZoom != (id)[NSNull null] && [withZoom boolValue]) { |
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.
same thing here, can we remove the condition ?
Using WKWebView instead of UIWebView
Removing commented code;
Using withZoom and hidden values;
Verifying WebView instance before "navigate", "evalJavascript", "resize" and "closeWebView".