Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,12 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## 2.0.1
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We usually update the version number only at the time of release, keeping 'Unreleased' until then. I think this helps avoid confusion about whether a feature has been released or not.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I updated with the upcoming version instead of “Unreleased”, since this is the only pending feature and we’re planning to release it next week. I had already validated this with Alexandre, and he suggested going ahead with the version update now.


### Features

- 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).

## 2.0.0

### Features
Expand Down
2 changes: 1 addition & 1 deletion OSInAppBrowserLib.podspec
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Pod::Spec.new do |spec|
spec.name = 'OSInAppBrowserLib'
spec.version = '2.0.0'
spec.version = '2.0.1'

spec.summary = 'The `OSInAppBrowserLib` is a library that provides a web browser view to load a web page within a Mobile Application.'
spec.description = <<-DESC
Expand Down
12 changes: 6 additions & 6 deletions OSInAppBrowserLib.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -468,7 +468,7 @@
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 17.2;
LOCALIZATION_PREFERS_STRING_CATALOGS = YES;
MARKETING_VERSION = 2.0.0;
MARKETING_VERSION = 2.0.1;
MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE;
MTL_FAST_MATH = YES;
ONLY_ACTIVE_ARCH = YES;
Expand Down Expand Up @@ -530,7 +530,7 @@
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 17.2;
LOCALIZATION_PREFERS_STRING_CATALOGS = YES;
MARKETING_VERSION = 2.0.0;
MARKETING_VERSION = 2.0.1;
MTL_ENABLE_DEBUG_INFO = NO;
MTL_FAST_MATH = YES;
SDKROOT = iphoneos;
Expand Down Expand Up @@ -563,7 +563,7 @@
"@executable_path/Frameworks",
"@loader_path/Frameworks",
);
MARKETING_VERSION = 2.0.0;
MARKETING_VERSION = 2.0.1;
MODULE_VERIFIER_SUPPORTED_LANGUAGES = "objective-c objective-c++";
MODULE_VERIFIER_SUPPORTED_LANGUAGE_STANDARDS = "gnu17 gnu++20";
PRODUCT_BUNDLE_IDENTIFIER = com.outsystems.rd.inappbrowser.OSInAppBrowserLib;
Expand Down Expand Up @@ -597,7 +597,7 @@
"@executable_path/Frameworks",
"@loader_path/Frameworks",
);
MARKETING_VERSION = 2.0.0;
MARKETING_VERSION = 2.0.1;
MODULE_VERIFIER_SUPPORTED_LANGUAGES = "objective-c objective-c++";
MODULE_VERIFIER_SUPPORTED_LANGUAGE_STANDARDS = "gnu17 gnu++20";
PRODUCT_BUNDLE_IDENTIFIER = com.outsystems.rd.inappbrowser.OSInAppBrowserLib;
Expand All @@ -618,7 +618,7 @@
CURRENT_PROJECT_VERSION = 2;
GENERATE_INFOPLIST_FILE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 17.0;
MARKETING_VERSION = 2.0.0;
MARKETING_VERSION = 2.0.1;
PRODUCT_BUNDLE_IDENTIFIER = com.outsystems.rd.inappbrowser.OSInAppBrowserLibTests;
PRODUCT_NAME = "$(TARGET_NAME)";
SUPPORTED_PLATFORMS = "iphoneos iphonesimulator";
Expand All @@ -640,7 +640,7 @@
CURRENT_PROJECT_VERSION = 2;
GENERATE_INFOPLIST_FILE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 17.0;
MARKETING_VERSION = 2.0.0;
MARKETING_VERSION = 2.0.1;
PRODUCT_BUNDLE_IDENTIFIER = com.outsystems.rd.inappbrowser.OSInAppBrowserLibTests;
PRODUCT_NAME = "$(TARGET_NAME)";
SUPPORTED_PLATFORMS = "iphoneos iphonesimulator";
Expand Down
Binary file modified OSInAppBrowserLib.zip
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@ public class OSIABWebViewOptions: OSIABOptions {
let surpressIncrementalRendering: Bool
/// Sets a custom user agent for the WebView.
let customUserAgent: String?
/// Indicates if swipe gestures for navigating backward and forward in the WebView history are enabled.
let allowsBackForwardNavigationGestures: Bool

/// Constructor method.
/// - Parameters:
Expand All @@ -49,6 +51,7 @@ public class OSIABWebViewOptions: OSIABOptions {
/// - viewStyle: The view style to present. `defaultValue` is provided in case of no value.
/// - animationEffect: The animation effect for the presentation appearance and dismissal. `defaultValue` is provided in case of no value.
/// - customUserAgent: Sets a custom user agent for the WebView.`
/// - allowsBackForwardNavigationGestures: Indicates if swipe gestures for navigating backward and forward in the WebView history are enabled.
public init(
showURL: Bool = true,
showToolbar: Bool = true,
Expand All @@ -65,7 +68,8 @@ public class OSIABWebViewOptions: OSIABOptions {
surpressIncrementalRendering: Bool = false,
viewStyle: OSIABViewStyle = .defaultValue,
animationEffect: OSIABAnimationEffect = .defaultValue,
customUserAgent: String? = nil
customUserAgent: String? = nil,
allowsBackForwardNavigationGestures: Bool = true,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The default value of the WKWebView's allowsBackForwardNavigationGestures property is false. Would it make sense to change this default value?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I actually discussed this with Alexandre, and he suggested that enabling allowsBackForwardNavigationGestures by default makes more sense, as it improves the navigation experience in most use cases.

) {
self.showURL = showURL
self.showToolbar = showToolbar
Expand All @@ -81,6 +85,7 @@ public class OSIABWebViewOptions: OSIABOptions {
self.allowInLineMediaPlayback = allowInLineMediaPlayback
self.surpressIncrementalRendering = surpressIncrementalRendering
self.customUserAgent = customUserAgent
self.allowsBackForwardNavigationGestures = allowsBackForwardNavigationGestures
super.init(viewStyle: viewStyle, animationEffect: animationEffect)
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ public class OSIABWebViewRouterAdapter: NSObject, OSIABRouter {
self.options.toConfigurationModel().toWebViewConfiguration(),
self.options.allowOverScroll,
self.options.customUserAgent,
self.options.allowsBackForwardNavigationGestures,
uiModel: self.options.toUIModel(),
callbackHandler: self.callbackHandler
)
Expand Down
4 changes: 2 additions & 2 deletions OSInAppBrowserLib/WebView/OSIABWebViewModel.swift
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ class OSIABWebViewModel: NSObject, ObservableObject {
_ webViewConfiguration: WKWebViewConfiguration,
_ scrollViewBounces: Bool = true,
_ customUserAgent: String? = nil,
_ backForwardNavigationGestures: Bool = true,
uiModel: OSIABWebViewUIModel,
callbackHandler: OSIABWebViewCallbackHandler
) {
Expand All @@ -68,12 +69,11 @@ class OSIABWebViewModel: NSObject, ObservableObject {
self.leftToRight = uiModel.leftToRight

super.init()

self.webView.allowsBackForwardNavigationGestures = backForwardNavigationGestures
self.webView.scrollView.bounces = scrollViewBounces
self.webView.customUserAgent = customUserAgent
self.webView.navigationDelegate = self
self.webView.uiDelegate = self

self.setupBindings(uiModel.showURL, uiModel.showToolbar, uiModel.showNavigationButtons)
}

Expand Down
Loading