The app is being crashed when trying to hide the navigation bar for a ViewController only for iOS 13 users.
- I got the crash on Crashlytics of Fabric which titled as below,
Fatal Exception: NSInternalInconsistencyException
threading violation: expected the main thread
- I tried by hiding the NavigationBar for particular ViewController by using NavigationController's delegate method.
func navigationController(_ navigationController: UINavigationController, willShow viewController: UIViewController, animated: Bool) {
let hide = (viewController is MyVC)
navigationController.setNavigationBarHidden(hide, animated: animated)
}Please help.
Thanks