iOS 13 introduces a new design of modalPresentationStyle .pageSheet (and its sibling .formSheet) for modally presente
The property isModalInPresentation might help.
From the documentation:
When you set it to
true, UIKit ignores events outside the view controller's bounds and prevents the interactive dismissal of the view controller while it is onscreen.
You can use it like this:
let controller = MyViewController()
controller.isModalInPresentation = true
self.present(controller, animated: true, completion: nil)