Skip to content

feat(gesture): implement DragGesture - #1168

Merged
Kyle-Ye merged 5 commits into
mainfrom
feature/drag_gesture
Oct 17, 2026
Merged

Kyle-Ye merged 5 commits into
mainfrom
feature/drag_gesture

Conversation

@Kyle-Ye

@Kyle-Ye Kyle-Ye commented Oct 17, 2026 •

Copy link
Copy Markdown
Member

Summary

Close #1153

  • Implement DragGesture and DragGesture.Value, including translation, velocity, and predicted end values, with public documentation.
  • Start a drag only after it moves the minimum distance, using touch events on iOS and visionOS and mouse events on macOS.
  • Add _EventDirections and CGSize magnitude and normalization helpers used to measure drag movement.
  • Add a drag example, a drag helper for the interaction test host, and interaction tests for translation and minimum distance.
  • Update Hammer to 0.19.3 so synthetic macOS drags start at the requested location.

Validation

  • Drag gesture interaction tests pass with SwiftUI and OpenSwiftUI on macOS, including the minimum-distance case.

Dependency

@github-actions github-actions Bot added area: event-gesture Events, gestures, tracing, or interaction plumbing. type: feature New API, behavior, platform support, or user-facing capability. labels Oct 17, 2026
@tuist

tuist Bot commented Oct 17, 2026 •

Copy link
Copy Markdown

🛠️ Tuist Run Report 🛠️

Tests 🧪

Scheme Status Ran test modules Commit
Unknown ⏳ 7 19aab218e
OpenSwiftUI ✅ 7 19aab218e

Builds 🔨

Scheme Status Duration Commit
OpenSwiftUI ✅ 44.6s 19aab218e

@codecov

codecov Bot commented Oct 17, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 0% with 104 lines in your changes missing coverage. Please review.
✅ Project coverage is 29.51%. Comparing base (ee1cf1d) to head (ce264cd).
⚠️ Report is 9 commits behind head on main.

Files with missing lines Patch % Lines
...ources/OpenSwiftUI/Event/Gesture/DragGesture.swift 0.00% 78 Missing ⚠️
...es/OpenSwiftUI/Event/Gesture/EventDirections.swift 0.00% 13 Missing ⚠️
...s/OpenSwiftUICore/Util/Extension/CGSize+Math.swift 0.00% 13 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1168      +/-   ##
==========================================
- Coverage   30.43%   29.51%   -0.92%     
==========================================
  Files         913      941      +28     
  Lines       71182    74552    +3370     
==========================================
+ Hits        21662    22007     +345     
- Misses      49520    52545    +3025     

☔ 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 commented Oct 17, 2026

Copy link
Copy Markdown
Member Author

/interactiontest osui-iag update only-testing=OpenSwiftUIInteractionTests/DragGestureInteractionTests

@Kyle-Ye
Kyle-Ye merged commit 4a8e9bd into main Oct 17, 2026
8 checks passed
@Kyle-Ye
Kyle-Ye deleted the feature/drag_gesture branch October 17, 2026 09:40
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. type: feature New API, behavior, platform support, or user-facing capability.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add DragGesture support

1 participant