Skip to main content

setIosSwipeGestureEnabled

Enables or disables the iOS left-edge swipe-to-go-back gesture. Has no effect on Android.

Signature

import { setIosSwipeGestureEnabled } from '@apps-in-toss/web-framework';

declare function setIosSwipeGestureEnabled(options: {
isEnabled: boolean;
}): Promise<void>;

Parameters

NameTypeRequiredDescription
options.isEnabledbooleantrue enables the swipe-back gesture; false disables it.

Returns

  • Promise<void> — resolves once the setting is delivered.
  • In the devtools mock, a log entry is printed to the console.
iOS only

This API only takes effect on iOS. On Android the call is ignored.

Permission

No permission required.

Examples

Minimal

import { setIosSwipeGestureEnabled } from '@apps-in-toss/web-framework';

// Disable swipe-back.
await setIosSwipeGestureEnabled({ isEnabled: false });

Realistic — prevent accidental navigation during payment entry

import { setIosSwipeGestureEnabled } from '@apps-in-toss/web-framework';
import { useEffect } from 'react';

export function PaymentForm() {
useEffect(() => {
// Disable swipe-back while the user is filling in payment details.
setIosSwipeGestureEnabled({ isEnabled: false });

return () => {
// Restore when leaving the screen.
setIosSwipeGestureEnabled({ isEnabled: true });
};
}, []);

return <form>{/* Payment input fields */}</form>;
}

Try it live

Open the Navigation page in sdk-example and run the setIosSwipeGestureEnabled card.

Open in sdk-example

External references