cordova-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From shaz...@apache.org
Subject [30/43] ios commit: Use default web view engine (UIWebView) if external web engine is not supported in the current runtime version, or it doesn't conform to the protocol.
Date Sat, 07 Mar 2015 00:18:43 GMT
Use default web view engine (UIWebView) if external web engine is not supported in the current
runtime version, or it doesn't conform to the protocol.


Project: http://git-wip-us.apache.org/repos/asf/cordova-ios/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-ios/commit/3487ffba
Tree: http://git-wip-us.apache.org/repos/asf/cordova-ios/tree/3487ffba
Diff: http://git-wip-us.apache.org/repos/asf/cordova-ios/diff/3487ffba

Branch: refs/heads/4.0.x
Commit: 3487ffba992bd3f2cca447d357f6768f0dacaf37
Parents: c343e2e
Author: Shazron Abdullah <shazron@gmail.com>
Authored: Mon Nov 10 09:43:37 2014 -0800
Committer: Shazron Abdullah <shazron@gmail.com>
Committed: Mon Nov 10 09:43:37 2014 -0800

----------------------------------------------------------------------
 CordovaLib/Classes/CDVViewController.m | 4 ++++
 1 file changed, 4 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-ios/blob/3487ffba/CordovaLib/Classes/CDVViewController.m
----------------------------------------------------------------------
diff --git a/CordovaLib/Classes/CDVViewController.m b/CordovaLib/Classes/CDVViewController.m
index a76b6e7..e59bdd7 100644
--- a/CordovaLib/Classes/CDVViewController.m
+++ b/CordovaLib/Classes/CDVViewController.m
@@ -435,6 +435,10 @@
     // Find webViewEngine
     if (NSClassFromString(webViewEngineClass)) {
         self.webViewEngine = [[NSClassFromString(webViewEngineClass) alloc] initWithFrame:bounds];
+        // if a webView engine returns nil (not supported by the current iOS version) or
doesn't conform to the protocol, we use UIWebView
+        if (!self.webViewEngine || ![self.webViewEngine conformsToProtocol:@protocol(CDVWebViewEngineProtocol)])
{
+            self.webViewEngine = [[NSClassFromString(defaultWebViewEngineClass) alloc] initWithFrame:bounds];
+        }
     } else {
         self.webViewEngine = [[NSClassFromString(defaultWebViewEngineClass) alloc] initWithFrame:bounds];
     }


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


Mime
View raw message