Add Safari-like swiping through page history to my PWA?

I would like finger-following swiping between pages, just like Safari has, for forwards and backwards.

ChatGPT’s told me:

Why it’s not trivial

  • Ionic’s built-in swipe-back doesn’t support forward swipes.
  • Safari-style bidirectional interactive navigation is not natively supported because:
    • Ionic’s navigation is stack-based, not a “carousel” or “horizontal paging” system.
    • True interactive gestures require manual control of page positions and transitions.

Difference between Safari and WKWebView

Feature Safari WKWebView (iOS WebView)
Back swipe gesture Built-in, interactive, native Not built-in
Forward swipe gesture Built-in, interactive, native Not built-in
Page stacking / navigation stack Native, tied to OS You manage it in JavaScript (history API)
Interactive transitions Yes (peeking, smooth dragging) Only if implemented manually

Safari’s back/forward swipe is built into iOS . It’s part of the UIWebView / WKWebView controller layer , not the web content layer

Is all of this correct and current?

What’s the easiest way to add Safari-like history swiping to my PWA?

1 Like

Please don’t post questions like “Is what ChatGPT said correct?” Instead, read the official Ionic documentation, and then ask a question based on that.

You can implement forward/backward swiping in an Ionic React app, but you have to create a navigation control to keep track of what page is “next” yourself; react router v5, which Ionic React uses, doesn’t have a function for doing that.

1 Like