[iOS18] QLPreviewController - No more swipe to dismiss?

Have the requirements to support swipe to dismiss from a quick-look view controller changed in iOS18? I am noticing that my app no longer supports gestural dismissal in an iOS18 build.

Not this is a QLPreviewController presented from a UIViewController presented in a SwiftUI view hierarchy as part of a ViewControllerRepresentable.

Answered by J0hn in 800817022

Workaround: Assign a delegate and implement:

func previewController(_ controller: QLPreviewController, transitionViewFor item: QLPreviewItem) -> UIView? {
    UIView()
}

If anyone at Apple would like this fixed, please file a radar.

Accepted Answer

Workaround: Assign a delegate and implement:

func previewController(_ controller: QLPreviewController, transitionViewFor item: QLPreviewItem) -> UIView? {
    UIView()
}

If anyone at Apple would like this fixed, please file a radar.

Thanks @J0hn but I noticed this creates a little white view during dismissal. I've done this for now so when you drag you still see the preview's view.


func previewController(_ controller: QLPreviewController, transitionViewFor item: any QLPreviewItem) -> UIView? {
        if controller.isBeingDismissed {
            return controller.view
        }
        return nil
    }

It seems to me that, no matter which of the two variants posted above I'm using, the very first presentation does not look smooth. On the very first presentation I briefly get a white screen (when using the empty UIView) or a transparent screen (when using controller.view) before the presentation.

Also, I do not really understand why this solution is working at all? Why does implementing that delegate call enable the swipe down to dismiss? Did you find it out by accident?

[iOS18] QLPreviewController - No more swipe to dismiss?
 
 
Q