Skip to content

Commit ce62d41

Browse files
committed
added new gesture to allow back and forward gestures on webview
1 parent 9c4133b commit ce62d41

File tree

7 files changed

+22
-10
lines changed

7 files changed

+22
-10
lines changed

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,12 @@ All notable changes to this project will be documented in this file.
44
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
55
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
66

7+
## 2.0.1
8+
9+
### Features
10+
11+
- Added support for back and forward swipe navigation gestures in `WKWebView` via the `allowsBackForwardNavigationGestures` option. (for openInWebView option only) (https://outsystemsrd.atlassian.net/browse/RMET-4216).
12+
713
## 2.0.0
814

915
### Features

OSInAppBrowserLib.podspec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
Pod::Spec.new do |spec|
22
spec.name = 'OSInAppBrowserLib'
3-
spec.version = '2.0.0'
3+
spec.version = '2.0.1'
44

55
spec.summary = 'The `OSInAppBrowserLib` is a library that provides a web browser view to load a web page within a Mobile Application.'
66
spec.description = <<-DESC

OSInAppBrowserLib.xcodeproj/project.pbxproj

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -468,7 +468,7 @@
468468
GCC_WARN_UNUSED_VARIABLE = YES;
469469
IPHONEOS_DEPLOYMENT_TARGET = 17.2;
470470
LOCALIZATION_PREFERS_STRING_CATALOGS = YES;
471-
MARKETING_VERSION = 2.0.0;
471+
MARKETING_VERSION = 2.0.1;
472472
MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE;
473473
MTL_FAST_MATH = YES;
474474
ONLY_ACTIVE_ARCH = YES;
@@ -530,7 +530,7 @@
530530
GCC_WARN_UNUSED_VARIABLE = YES;
531531
IPHONEOS_DEPLOYMENT_TARGET = 17.2;
532532
LOCALIZATION_PREFERS_STRING_CATALOGS = YES;
533-
MARKETING_VERSION = 2.0.0;
533+
MARKETING_VERSION = 2.0.1;
534534
MTL_ENABLE_DEBUG_INFO = NO;
535535
MTL_FAST_MATH = YES;
536536
SDKROOT = iphoneos;
@@ -563,7 +563,7 @@
563563
"@executable_path/Frameworks",
564564
"@loader_path/Frameworks",
565565
);
566-
MARKETING_VERSION = 2.0.0;
566+
MARKETING_VERSION = 2.0.1;
567567
MODULE_VERIFIER_SUPPORTED_LANGUAGES = "objective-c objective-c++";
568568
MODULE_VERIFIER_SUPPORTED_LANGUAGE_STANDARDS = "gnu17 gnu++20";
569569
PRODUCT_BUNDLE_IDENTIFIER = com.outsystems.rd.inappbrowser.OSInAppBrowserLib;
@@ -597,7 +597,7 @@
597597
"@executable_path/Frameworks",
598598
"@loader_path/Frameworks",
599599
);
600-
MARKETING_VERSION = 2.0.0;
600+
MARKETING_VERSION = 2.0.1;
601601
MODULE_VERIFIER_SUPPORTED_LANGUAGES = "objective-c objective-c++";
602602
MODULE_VERIFIER_SUPPORTED_LANGUAGE_STANDARDS = "gnu17 gnu++20";
603603
PRODUCT_BUNDLE_IDENTIFIER = com.outsystems.rd.inappbrowser.OSInAppBrowserLib;
@@ -618,7 +618,7 @@
618618
CURRENT_PROJECT_VERSION = 2;
619619
GENERATE_INFOPLIST_FILE = YES;
620620
IPHONEOS_DEPLOYMENT_TARGET = 17.0;
621-
MARKETING_VERSION = 2.0.0;
621+
MARKETING_VERSION = 2.0.1;
622622
PRODUCT_BUNDLE_IDENTIFIER = com.outsystems.rd.inappbrowser.OSInAppBrowserLibTests;
623623
PRODUCT_NAME = "$(TARGET_NAME)";
624624
SUPPORTED_PLATFORMS = "iphoneos iphonesimulator";
@@ -640,7 +640,7 @@
640640
CURRENT_PROJECT_VERSION = 2;
641641
GENERATE_INFOPLIST_FILE = YES;
642642
IPHONEOS_DEPLOYMENT_TARGET = 17.0;
643-
MARKETING_VERSION = 2.0.0;
643+
MARKETING_VERSION = 2.0.1;
644644
PRODUCT_BUNDLE_IDENTIFIER = com.outsystems.rd.inappbrowser.OSInAppBrowserLibTests;
645645
PRODUCT_NAME = "$(TARGET_NAME)";
646646
SUPPORTED_PLATFORMS = "iphoneos iphonesimulator";

OSInAppBrowserLib.zip

86.8 KB
Binary file not shown.

OSInAppBrowserLib/Models/Options/OSIABWebViewOptions.swift

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,8 @@ public class OSIABWebViewOptions: OSIABOptions {
3030
let surpressIncrementalRendering: Bool
3131
/// Sets a custom user agent for the WebView.
3232
let customUserAgent: String?
33+
/// Indicates if swipe gestures for navigating backward and forward in the WebView history are enabled.
34+
let allowsBackForwardNavigationGestures: Bool
3335

3436
/// Constructor method.
3537
/// - Parameters:
@@ -49,6 +51,7 @@ public class OSIABWebViewOptions: OSIABOptions {
4951
/// - viewStyle: The view style to present. `defaultValue` is provided in case of no value.
5052
/// - animationEffect: The animation effect for the presentation appearance and dismissal. `defaultValue` is provided in case of no value.
5153
/// - customUserAgent: Sets a custom user agent for the WebView.`
54+
/// - allowsBackForwardNavigationGestures: Indicates if swipe gestures for navigating backward and forward in the WebView history are enabled.
5255
public init(
5356
showURL: Bool = true,
5457
showToolbar: Bool = true,
@@ -65,7 +68,8 @@ public class OSIABWebViewOptions: OSIABOptions {
6568
surpressIncrementalRendering: Bool = false,
6669
viewStyle: OSIABViewStyle = .defaultValue,
6770
animationEffect: OSIABAnimationEffect = .defaultValue,
68-
customUserAgent: String? = nil
71+
customUserAgent: String? = nil,
72+
allowsBackForwardNavigationGestures: Bool = true,
6973
) {
7074
self.showURL = showURL
7175
self.showToolbar = showToolbar
@@ -81,6 +85,7 @@ public class OSIABWebViewOptions: OSIABOptions {
8185
self.allowInLineMediaPlayback = allowInLineMediaPlayback
8286
self.surpressIncrementalRendering = surpressIncrementalRendering
8387
self.customUserAgent = customUserAgent
88+
self.allowsBackForwardNavigationGestures = allowsBackForwardNavigationGestures
8489
super.init(viewStyle: viewStyle, animationEffect: animationEffect)
8590
}
8691
}

OSInAppBrowserLib/RouterAdapters/OSIABWebViewRouterAdapter.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ public class OSIABWebViewRouterAdapter: NSObject, OSIABRouter {
3939
self.options.toConfigurationModel().toWebViewConfiguration(),
4040
self.options.allowOverScroll,
4141
self.options.customUserAgent,
42+
self.options.allowsBackForwardNavigationGestures,
4243
uiModel: self.options.toUIModel(),
4344
callbackHandler: self.callbackHandler
4445
)

OSInAppBrowserLib/WebView/OSIABWebViewModel.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@ class OSIABWebViewModel: NSObject, ObservableObject {
4949
_ webViewConfiguration: WKWebViewConfiguration,
5050
_ scrollViewBounces: Bool = true,
5151
_ customUserAgent: String? = nil,
52+
_ backForwardNavigationGestures: Bool = true,
5253
uiModel: OSIABWebViewUIModel,
5354
callbackHandler: OSIABWebViewCallbackHandler
5455
) {
@@ -68,12 +69,11 @@ class OSIABWebViewModel: NSObject, ObservableObject {
6869
self.leftToRight = uiModel.leftToRight
6970

7071
super.init()
71-
72+
self.webView.allowsBackForwardNavigationGestures = backForwardNavigationGestures
7273
self.webView.scrollView.bounces = scrollViewBounces
7374
self.webView.customUserAgent = customUserAgent
7475
self.webView.navigationDelegate = self
7576
self.webView.uiDelegate = self
76-
7777
self.setupBindings(uiModel.showURL, uiModel.showToolbar, uiModel.showNavigationButtons)
7878
}
7979

0 commit comments

Comments
 (0)