Skip to content
1 change: 1 addition & 0 deletions ios/Capacitor/Capacitor/CAPBridgeViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -301,6 +301,7 @@ extension CAPBridgeViewController {
aWebView.scrollView.bounces = false
aWebView.scrollView.contentInsetAdjustmentBehavior = configuration.contentInsetAdjustmentBehavior
aWebView.allowsLinkPreview = configuration.allowLinkPreviews
aWebView.allowsBackForwardNavigationGestures = configuration.allowsBackForwardNavigationGestures
aWebView.scrollView.isScrollEnabled = configuration.scrollingEnabled
if let overrideUserAgent = configuration.overridenUserAgentString {
aWebView.customUserAgent = overrideUserAgent
Expand Down
1 change: 1 addition & 0 deletions ios/Capacitor/Capacitor/CAPInstanceConfiguration.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ NS_SWIFT_NAME(InstanceConfiguration)
@property (nonatomic, readonly) BOOL scrollingEnabled;
@property (nonatomic, readonly) BOOL zoomingEnabled;
@property (nonatomic, readonly) BOOL allowLinkPreviews;
@property (nonatomic, readonly) BOOL allowsBackForwardNavigationGestures;
@property (nonatomic, readonly) BOOL handleApplicationNotifications;
@property (nonatomic, readonly) BOOL isWebDebuggable;
@property (nonatomic, readonly) BOOL hasInitialFocus;
Expand Down
2 changes: 2 additions & 0 deletions ios/Capacitor/Capacitor/CAPInstanceConfiguration.m
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ - (instancetype)initWithDescriptor:(CAPInstanceDescriptor *)descriptor isDebug:(
_scrollingEnabled = descriptor.scrollingEnabled;
_zoomingEnabled = descriptor.zoomingEnabled;
_allowLinkPreviews = descriptor.allowLinkPreviews;
_allowsBackForwardNavigationGestures = descriptor.allowsBackForwardNavigationGestures;
_handleApplicationNotifications = descriptor.handleApplicationNotifications;
_contentInsetAdjustmentBehavior = descriptor.contentInsetAdjustmentBehavior;
_appLocation = descriptor.appLocation;
Expand Down Expand Up @@ -70,6 +71,7 @@ - (instancetype)initWithConfiguration:(CAPInstanceConfiguration*)configuration a
_scrollingEnabled = configuration.scrollingEnabled;
_zoomingEnabled = configuration.zoomingEnabled;
_allowLinkPreviews = configuration.allowLinkPreviews;
_allowsBackForwardNavigationGestures = configuration.allowsBackForwardNavigationGestures;
_handleApplicationNotifications = configuration.handleApplicationNotifications;
_isWebDebuggable = configuration.isWebDebuggable;
_hasInitialFocus = configuration.hasInitialFocus;
Expand Down
5 changes: 5 additions & 0 deletions ios/Capacitor/Capacitor/CAPInstanceDescriptor.h
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,11 @@ NS_SWIFT_NAME(InstanceDescriptor)
@discussion Set by @c ios.allowsLinkPreview in the configuration file. Corresponds to @c allowsLinkPreview on WKWebView.
*/
@property (nonatomic, assign) BOOL allowLinkPreviews;
/**
@brief Whether or not the web view will allow gesture navigation .
@discussion Set by @c ios.allowsBackForwardNavigationGestures in the configuration file. Corresponds to @c allowsBackForwardNavigationGestures on WKWebView.
*/
@property (nonatomic, assign) BOOL allowsBackForwardNavigationGestures;
Comment on lines +96 to +100
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor

Minor typo in documentation comment.

The property declaration is correct and follows the established pattern. However, there's an extra space before the period on line 97: "gesture navigation ." should be "gesture navigation."

Apply this diff to fix the typo:

 /**
- @brief Whether or not the web view will allow gesture navigation .
+ @brief Whether or not the web view will allow gesture navigation.
  @discussion Set by @c ios.allowsBackForwardNavigationGestures in the configuration file. Corresponds to @c allowsBackForwardNavigationGestures on WKWebView.
  */
 @property (nonatomic, assign) BOOL allowsBackForwardNavigationGestures;
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
/**
@brief Whether or not the web view will allow gesture navigation .
@discussion Set by @c ios.allowsBackForwardNavigationGestures in the configuration file. Corresponds to @c allowsBackForwardNavigationGestures on WKWebView.
*/
@property (nonatomic, assign) BOOL allowsBackForwardNavigationGestures;
/**
@brief Whether or not the web view will allow gesture navigation.
@discussion Set by @c ios.allowsBackForwardNavigationGestures in the configuration file. Corresponds to @c allowsBackForwardNavigationGestures on WKWebView.
*/
@property (nonatomic, assign) BOOL allowsBackForwardNavigationGestures;
🤖 Prompt for AI Agents
In ios/Capacitor/Capacitor/CAPInstanceDescriptor.h around lines 96 to 100, the
documentation comment has an extra space before the period in "gesture
navigation ."; remove the stray space so the sentence reads "gesture
navigation." to match the established comment formatting and punctuation.

/**
@brief Whether or not the Capacitor runtime will set itself as the @c UNUserNotificationCenter delegate.
@discussion Defaults to @c true. Required to be @c true for notification plugins to work correctly. Set to @c false if your application will handle notifications independently.
Expand Down
1 change: 1 addition & 0 deletions ios/Capacitor/Capacitor/CAPInstanceDescriptor.m
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ - (void)_setDefaultsWithAppLocation:(NSURL*)location {
_scrollingEnabled = YES;
_zoomingEnabled = NO;
_allowLinkPreviews = YES;
_allowsBackForwardNavigationGestures = NO;
_handleApplicationNotifications = YES;
_isWebDebuggable = NO;
_hasInitialFocus = YES;
Expand Down
3 changes: 3 additions & 0 deletions ios/Capacitor/Capacitor/CAPInstanceDescriptor.swift
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,9 @@ internal extension InstanceDescriptor {
if let allowPreviews = config[keyPath: "ios.allowsLinkPreview"] as? Bool {
allowLinkPreviews = allowPreviews
}
if let allowsNavigationGestures = config[keyPath: "ios.allowsBackForwardNavigationGestures"] as? Bool {
allowsBackForwardNavigationGestures = allowsNavigationGestures
}
if let scrollEnabled = config[keyPath: "ios.scrollEnabled"] as? Bool {
scrollingEnabled = scrollEnabled
}
Expand Down
Loading