in UIKit
there is an option to disable "Home" system swipe up from bottom (not completely disable, but swipe ignores first time and will force user to repeat it if he really wants it). setNeedsUpdateOfScreenEdgesDeferringSystemGestures()
actually does right what I need.
But how do I reach the same in SwiftUI?
I tried to call this method in SceneDelegate like this:
let window = UIWindow(windowScene: windowScene)
let uiKitView = UIHostingController(rootView: contentView)
uiKitView.setNeedsUpdateOfScreenEdgesDeferringSystemGestures()
window.rootViewController = uiKitView
but its doesn't work if you doesn't override preferredScreenEdgesDeferringSystemGestures
to return .all
I can't override this computed property of UIHostingController
:
extension UIHostingController {
open override var preferredScreenEdgesDeferringSystemGestures: UIRectEdge{
return [.all];
}
}
I gets warning:
Extensions of generic classes cannot contain '@objc' members
Anybody knows how to reach that?