You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@cordova.apache.org by GitBox <gi...@apache.org> on 2021/01/06 16:41:55 UTC

[GitHub] [cordova-ios] dpogue commented on a change in pull request #1050: feat: add CDVWebViewEngineConfigurationDelegate

dpogue commented on a change in pull request #1050:
URL: https://github.com/apache/cordova-ios/pull/1050#discussion_r552788845



##########
File path: CordovaLib/Classes/Public/CDVViewController.m
##########
@@ -505,9 +505,10 @@ - (UIView*)newCordovaViewWithFrame:(CGRect)bounds
             self.webViewEngine = [[NSClassFromString(defaultWebViewEngineClass) alloc] initWithFrame:bounds];
         }
     } else {
-        self.webViewEngine = [[NSClassFromString(defaultWebViewEngineClass) alloc] initWithFrame:bounds];
+        WKWebViewConfiguration *config = [self respondsToSelector:@selector(configuration)] ? [self configuration] : nil;
+        self.webViewEngine = [[NSClassFromString(defaultWebViewEngineClass) alloc] initWithFrame:bounds configuration:config];

Review comment:
       It looks like you're only applying this in the case when an engine is not specified.
   
   What might be best is to make a private `initWebViewEngine:(NSClass)engineClass` method that takes in the engine class, and checks if it responds to `initWithFrame:configuration:` and calls that, falling back to `initWithFrame:`.
   
   Then we'd call `initWebViewEngine:` on lines 502, 505, and 509 here




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org
For additional commands, e-mail: issues-help@cordova.apache.org