Skip to content

iOS simulator edge swipes never start UIScreenEdgePanGestureRecognizer #4208

Open

Description

@gronxb

Environment

  • agent-device 0.21.36, 0.21.36-nightly.20261031.115, and main at 035c2b6ca.
  • iPhone 16 on iOS 26.4, iPhone 17 and iPhone 18 Pro on iOS 27.2, and iPhone Duo on iOS 27.1 (open and closed) simulators.
  • macOS with Xcode, SDK iphonesimulator 27.2.

Description

gesture swipe left-edge and right-edge do not start screen-edge gestures on iOS simulators. The touch reaches the app, but UIKit does not mark it as a screen-edge touch (UITouch._edgeType is 0). A UIScreenEdgePanGestureRecognizer stays in .possible and never calls its action.

A UINavigationController back swipe still works, but only because of the iOS 26 full-content pop gesture. With that gesture off, the screen does not pop.

It fails on every version I tested. I do not know of a version where it worked.

The start coordinate is not the cause. XCTest synthesized touches carry no edge information, even at x = 0. A hand swipe from the left edge on the iPhone Duo inner panel shows what UIKit expects. Its digitizer events carry SwipeLocked and the native swipe direction (SwipeUp on that rotated panel) on every frame, and the first move is short:

Touch _edgeType Edge recognizer Navigation pop
gesture swipe right-edge (XCTest, x = 8) 0 never began no
XCTest swipe at x = 0.0 (viewport inset removed locally) 0 never began not tested
Hand swipe, Duo inner panel 4 began when the first move was short, failed after a jump of about 150 pt n/a
IOHID touch, FromEdgeFlat | FromEdgeTip mask, single-display iPhone 1 began, changed, ended yes
Same touch, Duo inner panel 1 never began no
IOHID touch, SwipeLocked and native swipe direction, first move eased in, every simulator above 4 began, changed, ended yes

Required behavior

  • On an iOS simulator, gesture swipe left-edge and right-edge deliver a touch that UIKit marks as a screen-edge touch.
  • Other gestures keep their current dispatch path.
  • Physical devices keep their current behavior. Device support is out of scope until it is verified on hardware.

Completion conditions

  • ./repro.sh from the demo below exits 0: all three cases pass.
  • Planner and runner tests cover the edge-preset route, and existing gesture tests pass on iOS and Android.

Dependencies

None.

Reproducible Demo

2026-11-04.1.30.10.mov

gronxb/agent-device-repro@ios-edge-swipe: a minimal UIKit app built with swiftc, with no Xcode project. It needs Xcode, a booted iPhone simulator, and agent-device on PATH.

git clone -b ios-edge-swipe https://github.com/gronxb/agent-device-repro.git
cd agent-device-repro
./repro.sh            # exits 1 while any case fails

The app has one UIScreenEdgePanGestureRecognizer (edge: N counts .began) and a plain pan on the same view (pan: N) as a control. last: shows UITouch._edgeType and the recognizer states.

FAIL  right-edge -> left-edge recognizer             expected "edge: 1"
      "edge: 0" "pan: 1" "last: touch x=8.0 edgeType=0 states=never-began(possible)"
FAIL  left-edge -> right-edge recognizer             expected "edge: 1"
      "edge: 0" "pan: 1" "last: touch x=385.0 edgeType=0 states=never-began(possible)"
FAIL  right-edge -> UINavigationController pop       expected "nav root"
      "nav pushed"

./repro.sh --driver probe sends the same swipes as FromEdgeFlat | FromEdgeTip HID touches. Every case passes on a single-display iPhone.

Activity

  1. thymikee commented on Nov 4, 2026

    @thymikee
    Member

    Triage: bug. Confirmed: edge presets are planned as ordinary XCTest swipes from 1% or 99% of the width (packages/contracts/src/scroll-gesture.ts), and XCTest synthesized touches carry no edge type, so UIScreenEdgePanGestureRecognizer cannot begin. The fix needs a new simulator touch route (IOHID digitizer events with the edge mask). Adding a dispatch route is a maintainer decision, so this is parked until then. Thanks for the _edgeType table and the probe driver; they narrow what that route has to send.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions