The app is being crashed when trying to hide the navigation bar for a viewcontroller only for iOS 13 users.
Fatal Exception: NSInternalInconsistencyException
threading violation: expected the main thread
self.navigationController?.isNavigationBarHidden = true
override func viewWillAppear(_ animated: Bool) {
self.navigationController?.isNavigationBarHidden = true
super.viewWillAppear(animated)
}
override func viewWillDisappear(_ animated: Bool) {
self.navigationController?.isNavigationBarHidden = false
super.viewWillDisappear(animated)
}
do following action
DispatchQueue.main.async {
self.navigationController?.isNavigationBarHidden = false
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With