In my app i have two view controllers embedded in navigation controller (lets say viewControllerA and viewControllerB). In the rootviewcontroller I don't want to show navigation bar, so in viewWillAppear
and viewWillDisappear
i have added thes lines:
override func viewWillAppear(_ animated: Bool) {
self.navigationController?.setNavigationBarHidden(true, animated: false)
}
override func viewWillDisappear(_ animated: Bool) {
self.navigationController?.setNavigationBarHidden(false, animated: false)
}
Now from the viewcontrollerB when back button is typed under navigation bar (when it starts to disapear) black view appears. How to remove that black view?
P.S. I have set navigation bar isTranslucent
to false but it does not solve the problem. In my project i'm not using storyboards.