`UIHostingConfiguration` for cells not cancelling touches on `UIScrollView` scroll (drag)?

The default behavior on UIScrollView is that "canCancelContentTouches" is true.

  • If you add a UIButton to a UICollectionViewCell and then scroll (drag) the scroll view with a touch beginning on that button in that cell, it cancels ".touchUpInside" on the UIButton.
  • 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.

I couldn’t replicate the issue on a physical device using iOS 26 beta 1. It would be helpful if you can please provide a focused sample project, the OS version, and the build environment to reproduce it.

If you're not familiar with preparing a test project, take a look at Creating a test project.

I cannot seem to reproduce it (yet?) on iOS 26. But, I can reproduce it 100% of the time seemingly on iOS 16.X-18.X if I put the UICollectionView into a draggable sheet presentation.

I was able to "one-shot" a Swift Playground with ChatGPT to demonstrate this, and attached a video also:

Essentially, if you very carefully/slowly start a "drag" of the sheet within a SwiftUI Button, and then start to move the sheet, it does not cancel the Button. However, on iOS 26, it appears to be fixed either as a side-effect of the new UI effects changing the sheet's bounds, or it actually having been noticed and fixed. However, I do not know if disabling some of the new UI with Accessibility features will cause the issue to return, or if there's some other way for it to still occur.

Questions:

  1. Can you reproduce using the Playground? Try dragging very slowly/carefully.
  2. Is there a workaround/solution for this?

@DTS Engineer just out of curiosity, are you able to reproduce the above on iOS 26 with the new UI disabled?

@DTS Engineer Just following up, since this seems broken I went ahead and created FB18451208 and uploaded the files there instead of iCloud.

`UIHostingConfiguration` for cells not cancelling touches on `UIScrollView` scroll (drag)?
 
 
Q