# Swipe-back gesture is enabled on iOS

- **Pattern:** `ab-001969` (`mobile-ux-patterns.platform-conventions.swipe-back-ios`)
- **Severity:** medium
- **Lifecycle:** active
- **Last modified:** 2026-04-18
- **Canonical URL:** https://auditbuffet.com/patterns/ab-001969
- **License:** CC-BY-4.0 — attribute to AuditBuffet Pattern Catalog (https://auditbuffet.com/patterns/ab-001969)

## Why it matters

Setting `gestureEnabled: false` on a stack screen disables the iOS edge-swipe-back gesture for that route only — users learn to swipe back on every other screen, then hit one where it silently fails. They assume the app is broken. This pattern is most common when developers copy-paste screen options without realizing the flag's scope, and it is a specific anti-pattern called out in Apple's HIG navigation section.

## Severity rationale

Medium because the back button still works, but the inconsistency trains users to distrust navigation.

## Remediation

Audit every `Stack.Screen` and every `screenOptions` block for `gestureEnabled: false` and remove it unless there is a documented UX reason (e.g., mid-checkout to prevent accidental cancellation):

```tsx
<Stack.Navigator screenOptions={{ gestureEnabled: true, gestureDirection: 'horizontal' }}>
  <Stack.Screen name="Detail" component={DetailScreen} />
</Stack.Navigator>
```

Prefer `createNativeStackNavigator` over the legacy JS stack — swipe-back is native and smoother.

## Detection

- **ID:** `swipe-back-ios`
- **Severity:** `medium`
- **What to look for:** Enumerate all Stack.Screen definitions. For each, check the `gestureEnabled` setting — quote the actual value found. If using React Navigation, check whether `createNativeStackNavigator` or `createStackNavigator` is used (native stack supports swipe-back by default).
- **Pass criteria:** Swipe-back gesture is enabled on at least 100% of navigable screens on iOS via `gestureEnabled: true` (default in React Navigation native stack) or equivalent. No screen explicitly sets `gestureEnabled: false` without a documented UX reason.
- **Fail criteria:** Swipe-back gesture is disabled via `gestureEnabled: false` on any screen, or custom navigation does not support swipe-back on iOS.
- **Skip (N/A) when:** App is Android-only, or is a single-screen app with no navigation stack.
- **Detail on fail:** Quote the navigation config. `"React Navigation is configured but gestureEnabled: false set on DetailScreen — users must tap back button."` or `"Custom navigation does not support iOS swipe-back."`
- **Remediation:** React Navigation enables swipe-back by default on iOS. Ensure it is not disabled:

  ```tsx
  const Stack = createNativeStackNavigator();

  <Stack.Navigator
    screenOptions={{
      gestureEnabled: true,  // Enable swipe-back (default on iOS)
      gestureDirection: 'horizontal',
    }}
  >
    <Stack.Screen name="Home" component={HomeScreen} />
  </Stack.Navigator>
  ```

Taxons: user-experience

HTML version: https://auditbuffet.com/patterns/ab-001969
