Skip to content

feat(event): add UIKit gesture containers and hosting view inputs - #1068

Merged
Kyle-Ye merged 3 commits into
mainfrom
bugfix/gesture
Sep 11, 2026
Merged

Kyle-Ye merged 3 commits into
mainfrom
bugfix/gesture

Conversation

@Kyle-Ye

@Kyle-Ye Kyle-Ye commented Sep 11, 2026

Copy link
Copy Markdown
Member

Summary

  • Add UIKit gesture containers with recognizer registration, responder hierarchy traversal, and diagnostic descriptions.
  • Configure hosting view inputs with event binding and gesture container factories, delegate customization, and the host focus item.
  • Preserve explicit interface idioms and add navigation bridge input forwarding.

@github-actions github-actions Bot added area: event-gesture Events, gestures, tracing, or interaction plumbing. area: hosting-bridge SwiftUI bridge, UIHosting/NSHosting, representables, and platform host views. platform: iOS iOS-specific behavior or support. type: feature New API, behavior, platform support, or user-facing capability. labels Sep 11, 2026
@augmentcode

augmentcode Bot commented Sep 11, 2026

Copy link
Copy Markdown
🤖 Augment PR Summary

Summary: This PR enables UIKit-backed gesture-container plumbing for hosted OpenSwiftUI hierarchies.


Changes:

  • Declares the private UIKit gesture-container protocol and dynamic private-symbol shims.
  • Adds UIKitGestureContainer with recognizer discovery, registration cleanup, hierarchy traversal, and debug descriptions.
  • Configures UIKit hosting view inputs with responder event-binding and gesture-container factories.
  • Passes the host view through a new focus-item input using a weak box.
  • Preserves caller-provided interface idioms while deriving one from UIKit traits when absent.
  • Adds a UIKit navigation bridge hook and forwards hosting view inputs through it.
  • Makes platform view responders inherit ViewResponder, with UIKit retaining a weak host-view reference.
Technical Notes: The gesture integration uses dynamically resolved UIKit-private entry points so unavailable symbols safely fall back without invocation.

🤖 Was this summary useful? React with 👍 or 👎

@augmentcode augmentcode Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review completed. No suggestions at this time.

Comment augment review to trigger a new review at any time.

@augmentcode

augmentcode Bot commented Sep 11, 2026

Copy link
Copy Markdown

PR Risk Analyzer Agent 🛡️

👀 Human review needed

Justification

This PR adds substantive UIKit event/gesture runtime logic and activates previously-disabled hosting-view wiring. Key risk factors:

  • Private-API resolution via dlsym. UIGestureRecognizer_Private.m adds OpenSwiftUIGestureRecognizerRegisterInContainer, ...UnregisterFromContainer, and ...ContainerAncestralDescription, each resolving private symbols (_UIGestureRecognizerRegisterInContainer, etc.) at runtime. Behavior depends on undocumented UIKit internals and can silently no-op if the symbol is absent.
  • Newly-enabled code paths. _UIHostingView.HostViewGraph.modifyViewInputs un-comments and activates eventBindingBridgeFactory, gestureContainerFactory, host.delegate?.hostingView(_:willModifyViewInputs:), UIKitHostContainerFocusItemInput, and host.navigationBridge?.updateViewInputs. This changes live event/gesture and focus delivery for every UIKit-hosted view.
  • Force-casts in traversal. UIKitGestureContainer and ViewResponder.childGestureContainers use as! casts (container as! any _UIGestureRecognizerContainer, as! (UIResponder & _UIGestureRecognizerContainer)) during responder-hierarchy walks; a non-conforming container would trap at runtime.
  • Base-class change. AnyPlatformViewHost.swift re-parents NSViewResponder/UIViewResponder onto ViewResponder, a cross-cutting change to the responder model.
  • Incomplete pieces. UIKitNavigationBridge is a stub (_openSwiftUIUnimplementedWarning()), and the focus-item input file is marked Status: WIP.

These warrant maintainer review of correctness, crash safety, and platform-behavior impact rather than automatic approval. No sensitive/opted-out paths are touched.

Reviewed commit 47687dc

@augmentcode augmentcode Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Deep Code Review Agent🐛

Review completed with 2 suggestions.

Reviewed commit: 47687dc

@tuist

tuist Bot commented Sep 11, 2026 •

Copy link
Copy Markdown

🛠️ Tuist Run Report 🛠️

Builds 🔨

Scheme Status Duration Commit
OpenSwiftUI ✅ 33.3s bc84e41d7

@codecov

codecov Bot commented Sep 11, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 29.90%. Comparing base (be5749e) to head (89434c8).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #1068   +/-   ##
=======================================
  Coverage   29.90%   29.90%           
=======================================
  Files         790      790           
  Lines       62483    62483           
=======================================
  Hits        18688    18688           
  Misses      43795    43795           

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@Kyle-Ye
Kyle-Ye merged commit 2326d96 into main Sep 11, 2026
4 of 5 checks passed
@Kyle-Ye
Kyle-Ye deleted the bugfix/gesture branch September 11, 2026 15:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: event-gesture Events, gestures, tracing, or interaction plumbing. area: hosting-bridge SwiftUI bridge, UIHosting/NSHosting, representables, and platform host views. platform: iOS iOS-specific behavior or support. type: feature New API, behavior, platform support, or user-facing capability.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant