iOS 15 'Drag to Dismiss' Regression

It seems that iOS 15 has broken modal view controller 'drag to dismiss' under the following configuration:

  • The presented modal contains a nested scroll view
  • && the outer scroll view is horizontally scrollable

In iOS 13 and 14, UIScrollViews would propagate scroll events correctly, and despite the nested scroll view complexity, downwards scroll events would bubble up to the modal drag-to-dismiss gesture when appropriate.

In iOS 15, this seems to have broken (even for builds still targeting iOS 14). I'm presuming some of the internal logic for modal drag down changed to support the new sheet presentation APIs, and in doing so, nested scroll view support broke.

I'm curious as to how many others are running into this issue, and if anyone has found a workaround. I've submitted a bug report, although given how late it is in the beta cycle I'm not hopeful we'll see a fix before the public release of iOS 15.0.

Replies

(If anyone at Apple happens to be reading this, I've attached a demo project to FB9575496 demonstrating the issue).

  • What happens if the scrollView does not go up to the top but leaves some space to catch and drag ?

  • Not sure I completely follow this suggestion, but if you begin dragging from a region outside the scroll view, the modal gesture does work. However, I don't think this is a good solution: drags within the scrollview itself should work as it has in iOS 13/14. In my situation, the nested collection view takes the full screen height.

  • Sure, I did not propose this as a solution, just a test. And what happens if you scroll beyond the bottom of the scrollView ? In any case, thanks to feedback if you get answer to the FB report.

Spent some more time digging - I went as far as disassembling UIKitCore to see what changed. While debugging I noticed some slight differences to a UIScrollView private method between iOS 14/15 (_findScrollableAncestorIfNeededWithEvent:).

By subclassing a scroll/collection view and overriding + returning nil from _parentScrollView, you can get the iOS 15 logic to more closely follow what iOS 14 does. This fixes the modal drag issue, but it's not exactly a great workaround... pretty sure Apple won't want us overriding this private API (who knows what other effect it might have).

  • Any other workaround until apple fixes it?

Add a Comment

Facing the same issue. Is there a workaround to fix this issue?

Post not yet marked as solved Up vote reply of jogi Down vote reply of jogi

This is still not fixed in iOS 15.4.1

Does anyone know if the bug is acknowledged by Apple?

Faced the same bug. The only thing that "kinda" works for me is to add these lines:

if #available(iOS 15, *) {
    modalPresentationStyle = .fullScreen
}

If you are using the same workaround, don't forget to add some sort of a dismiss button.

alexeylobankov But this disables the swipe gesture. Right?