Skip to content

Commit dc81ebf

Browse files
committed
fix(ios): enableSwipeBackNavigation on ios 26+
1 parent ec68a19 commit dc81ebf

1 file changed

Lines changed: 14 additions & 2 deletions

File tree

packages/core/ui/page/index.ios.ts

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -189,9 +189,15 @@ class UIViewControllerImpl extends UIViewController {
189189
// only consider when interactive transitions are not enabled
190190
navigationController.interactivePopGestureRecognizer.delegate = navigationController;
191191
navigationController.interactivePopGestureRecognizer.enabled = owner.enableSwipeBackNavigation;
192+
if (SDK_VERSION >= 26) {
193+
navigationController.interactiveContentPopGestureRecognizer.enabled = owner.enableSwipeBackNavigation;
194+
}
192195
}
193196
} else {
194197
navigationController.interactivePopGestureRecognizer.enabled = false;
198+
if (SDK_VERSION >= 26) {
199+
navigationController.interactiveContentPopGestureRecognizer.enabled = false;
200+
}
195201
}
196202
}
197203
}
@@ -462,10 +468,16 @@ export class Page extends PageBase {
462468

463469
public _updateEnableSwipeBackNavigation(enabled: boolean) {
464470
const navController = this._ios.navigationController;
465-
if (this.frame && navController && navController.interactivePopGestureRecognizer) {
471+
if (this.frame && navController) {
466472
// Make sure we don't set true if cannot go back
467473
enabled = enabled && this.frame.canGoBack();
468-
navController.interactivePopGestureRecognizer.enabled = enabled;
474+
if (navController.interactivePopGestureRecognizer) {
475+
navController.interactivePopGestureRecognizer.enabled = enabled;
476+
}
477+
478+
if (SDK_VERSION >= 26 && navController.interactiveContentPopGestureRecognizer) {
479+
navController.interactiveContentPopGestureRecognizer.enabled = enabled;
480+
}
469481
}
470482
}
471483

0 commit comments

Comments
 (0)