The default behavior on UIScrollView
is that "canCancelContentTouches" is true
.
- If you add a
UIButton
to aUICollectionViewCell
and then scroll (drag) the scroll view with a touch beginning on that button in that cell, it cancels ".touchUpInside" on theUIButton
. - However, if you have a
Button
in a SwiftUI view configured with "contentConfiguration" it does not cancel the touch, and the button's action is triggered if the user is still touching that cell when the scroll (drag) completes.
Is there a way to forward the touch cancellations to the SwiftUI view, or is it expected that all interactivity is handled only in UIKit, and not inside of "contentConfiguration" in specific cases? This behavior seems to occur on all SwiftUI versions supporting UIHostingConfiguration
so far.