Skip to content
Merged
Changes from all commits
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
16 changes: 14 additions & 2 deletions packages/core/ui/page/index.ios.ts
Original file line number Diff line number Diff line change
Expand Up @@ -189,9 +189,15 @@ class UIViewControllerImpl extends UIViewController {
// only consider when interactive transitions are not enabled
navigationController.interactivePopGestureRecognizer.delegate = navigationController;
navigationController.interactivePopGestureRecognizer.enabled = owner.enableSwipeBackNavigation;
if (SDK_VERSION >= 26) {
navigationController.interactiveContentPopGestureRecognizer.enabled = owner.enableSwipeBackNavigation;
}
}
} else {
navigationController.interactivePopGestureRecognizer.enabled = false;
if (SDK_VERSION >= 26) {
navigationController.interactiveContentPopGestureRecognizer.enabled = false;
}
}
}
}
Expand Down Expand Up @@ -462,10 +468,16 @@ export class Page extends PageBase {

public _updateEnableSwipeBackNavigation(enabled: boolean) {
const navController = this._ios.navigationController;
if (this.frame && navController && navController.interactivePopGestureRecognizer) {
if (this.frame && navController) {
// Make sure we don't set true if cannot go back
enabled = enabled && this.frame.canGoBack();
navController.interactivePopGestureRecognizer.enabled = enabled;
if (navController.interactivePopGestureRecognizer) {
navController.interactivePopGestureRecognizer.enabled = enabled;
}

if (SDK_VERSION >= 26 && navController.interactiveContentPopGestureRecognizer) {
navController.interactiveContentPopGestureRecognizer.enabled = enabled;
}
}
}

Expand Down
Loading