You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cordova.apache.org by sh...@apache.org on 2017/02/19 00:53:44 UTC
cordova-plugin-wkwebview-engine git commit: Allow to configure
navigation by gestures
Repository: cordova-plugin-wkwebview-engine
Updated Branches:
refs/heads/master a16f3f7e2 -> d795e9c71
Allow to configure navigation by gestures
This adds a new configuration option "AllowBackForwardNavigationGestures":
When enabled, the navigation gestures for forward/backward are enabled (aka "Swipe Navigation")
This closes #25
Project: http://git-wip-us.apache.org/repos/asf/cordova-plugin-wkwebview-engine/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-plugin-wkwebview-engine/commit/d795e9c7
Tree: http://git-wip-us.apache.org/repos/asf/cordova-plugin-wkwebview-engine/tree/d795e9c7
Diff: http://git-wip-us.apache.org/repos/asf/cordova-plugin-wkwebview-engine/diff/d795e9c7
Branch: refs/heads/master
Commit: d795e9c71fa9fc7cb7a36b1a337c35e8a330527e
Parents: a16f3f7
Author: Fabian K�ster <ma...@fabian-koester.com>
Authored: Thu Dec 8 10:01:24 2016 +0100
Committer: Shazron Abdullah <sh...@gmail.com>
Committed: Sat Feb 18 14:06:42 2017 -0800
----------------------------------------------------------------------
README.md | 20 +++++++++++++++-----
src/ios/CDVWKWebViewEngine.m | 2 ++
2 files changed, 17 insertions(+), 5 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/cordova-plugin-wkwebview-engine/blob/d795e9c7/README.md
----------------------------------------------------------------------
diff --git a/README.md b/README.md
index 73542d8..a7c68af 100644
--- a/README.md
+++ b/README.md
@@ -55,12 +55,13 @@ WKWebView may not fully launch (the deviceready event may not fire) unless if th
#### config.xml
- <feature name="CDVWKWebViewEngine">
- <param name="ios-package" value="CDVWKWebViewEngine" />
- </feature>
-
- <preference name="CordovaWebViewEngine" value="CDVWKWebViewEngine" />
+```xml
+<feature name="CDVWKWebViewEngine">
+ <param name="ios-package" value="CDVWKWebViewEngine" />
+</feature>
+<preference name="CordovaWebViewEngine" value="CDVWKWebViewEngine" />
+```
Notes
------
@@ -77,6 +78,15 @@ Starting with [cordova-cli 5.4.0](https://www.npmjs.com/package/cordova), it wil
Upgrade to at least version 5.4.0 of the cordova-cli to use this new functionality.
+Enabling Navigation Gestures ("Swipe Navigation")
+-----------
+
+In order to allow swiping backwards and forwards in browser history like Safari does, you can set the following preference in your `config.xml`:
+
+```xml
+<preference name="AllowBackForwardNavigationGestures" value="true" />
+```
+
Limitations
--------
http://git-wip-us.apache.org/repos/asf/cordova-plugin-wkwebview-engine/blob/d795e9c7/src/ios/CDVWKWebViewEngine.m
----------------------------------------------------------------------
diff --git a/src/ios/CDVWKWebViewEngine.m b/src/ios/CDVWKWebViewEngine.m
index 5ffe290..4859248 100644
--- a/src/ios/CDVWKWebViewEngine.m
+++ b/src/ios/CDVWKWebViewEngine.m
@@ -274,6 +274,8 @@ static void * KVOContext = &KVOContext;
} else {
[wkWebView.scrollView setDecelerationRate:UIScrollViewDecelerationRateFast];
}
+
+ wkWebView.allowsBackForwardNavigationGestures = [settings cordovaBoolSettingForKey:@"AllowBackForwardNavigationGestures" defaultValue:NO];
}
- (void)updateWithInfo:(NSDictionary*)info
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cordova.apache.org
For additional commands, e-mail: commits-help@cordova.apache.org