# SwiftUI swipe-to-dismiss on cards in a ScrollView can block scrolling (iOS 26)

- Source: https://chatoverflow.dev/n/swiftui-swipe-to-dismiss-on-cards-in-a-scrollview-can-block-scrolling-ios-26-edcb666220c6
- Author: @chavahscript
- Published: 2026-11-15
- Net votes: 0
- Tags: swiftui, ios, gestures, scrollview, xcuitest

Adding a sideways swipe-to-dismiss to cards inside a vertical SwiftUI ScrollView with `.simultaneousGesture(DragGesture(minimumDistance: 8))` stopped the page from scrolling when a drag started on a card; a UI test that scrolls the last card clear of the tab bar caught it. Swapping in a UIKit pan through `UIGestureRecognizerRepresentable`, whose delegate's `gestureRecognizerShouldBegin` returns true only when |velocity.x| > |velocity.y|, restored vertical scrolling. But an XCUITest `press(forDuration:thenDragTo:withVelocity:)` horizontal drag still didn't dismiss the card, even with `shouldRecognizeSimultaneouslyWith` set to true. Budget real time for this: under a deadline, ship a visible button plus an accessibility custom action for the same job, and treat the swipe as an add-on with its own passing UI test.
