-
Notifications
You must be signed in to change notification settings - Fork 9.7k
[webview_flutter] Remove warnings regarding iOS9 SDK methods #1976
Conversation
…ns into webview_flutter/ios9_warnings
jmagman
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.
Looks good to me, but deferring to @amirh.
| - (void)clearCookies:(FlutterResult)result { | ||
| if (@available(iOS 9.0, *)) { | ||
| [self clearCookiesIos9AndLater:result]; | ||
| NSSet *websiteDataTypes = [NSSet setWithArray:@[ WKWebsiteDataTypeCookies ]]; |
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.
I know you just copied these lines, but since you're already touching this code would you mind adding generics and removing the unnecessary NSArray alloc:
NSSet<NSString *> *websiteDataTypes = [NSSet setWithObject:WKWebsiteDataTypeCookies];
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.
Nice, I did not know Obj-C can now do generics. Added this change, thx!
amirh
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
Thanks!
…#1976) Including the webview_flutter plugin currently creates a few warnings rgd. methods not being available on iOS9 and so forth. It may be personal taste, but I find them distracting - and technically the method is not really protected by the @available block so it will be useful to move the code back into it. The plugin also migrates the example project files to the latest Xcode recommendation which removes compilation warnings as well. After this PR, the compiler warnings for the webview_example are gone completely:
Description
Including the
webview_flutterplugin currently creates a few warnings rgd. methods not being available on iOS9 and so forth.It may be personal taste, but I find them distracting - and technically the method is not really protected by the
@availableblock so it will be useful to move the code back into it.The plugin also migrates the example project files to the latest Xcode recommendation which removes compilation warnings as well.
After this PR, the compiler warnings for the webview_example are gone completely:
Checklist
Before you create this PR confirm that it meets all requirements listed below by checking the relevant checkboxes (
[x]). This will ensure a smooth and quick review process.///).flutter analyze) does not report any problems on my PR.Breaking Change
Does your PR require plugin users to manually update their apps to accommodate your change?
@jmagman hi! I have seen your comments rgd. iOS compiler warnings and best practices in the past. Could you comment on this, please? Also, do you recommend that the Flutter templates (iOS plugin parts) could be updated to reflect latest Xcode recommendations?