Skip to content
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

Merged
merged 2 commits into from
Apr 1, 2018
Merged

Using WKWebView instead of UIWebView #54

merged 2 commits into from
Apr 1, 2018

Conversation

ciceroduarte
Copy link
Contributor

Removing commented code;
Using withZoom and hidden values;
Verifying WebView instance before "navigate", "evalJavascript", "resize" and "closeWebView".

Removing commented code;
Using withZoom and hidden values;
Verifying WebView instance before "navigate", "evalJavascript", "resize" and "closeWebView".
Copy link
Collaborator

@lejard-h lejard-h left a 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

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]) {
Copy link
Collaborator

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 ?

Copy link
Contributor Author

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

self.webview = [[WKWebView alloc] initWithFrame:rc];
self.webview.navigationDelegate = self;
[self.viewController.view addSubview:self.webview];

if (withZoom != (id)[NSNull null] && [withZoom boolValue]) {
Copy link
Collaborator

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 ?

@lejard-h lejard-h merged commit 0862327 into fluttercommunity:master Apr 1, 2018
charafau pushed a commit that referenced this pull request Apr 7, 2020
Using WKWebView instead of UIWebView
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants