I have pushed an UIHostingController which contains SwiftUI and set the navigationBar hidden:
class CoverVC : UIHostingController<AnyView>{
public init(shouldShowNavigationBar: Bool, rootView: ICloudSyncView) {
super.init(rootView: AnyView(rootView.navigationBarHidden(!shouldShowNavigationBar)))
self.navigationController?.interactivePopGestureRecognizer?.delegate = self
}
@objc required dynamic init?(coder aDecoder: NSCoder) {
fatalError("init(coder:) has not been implemented")
}
}
extension CoverVC: UIGestureRecognizerDelegate {
func gestureRecognizer(_ gestureRecognizer: UIGestureRecognizer, shouldBeRequiredToFailBy otherGestureRecognizer: UIGestureRecognizer) -> Bool {
return true
}
}
But the InteractivePopGestureRecognizer is disabled. How can I to solve this?