0

i have a problem i never had before. Normally i'm creating a

Navigation Controller --> BottomBarNavigationController --> Controller --> Detail Controller logic. The result is that i see a navigation bar at the top. Right now its shown in the editor but not at the emulator.

Here is my Storyboard:

And here is the resutl at the emulator: Screenshot

Here is the code i'm pushing to detail viewcontroller:

        self.performSegue(withIdentifier: "showChat", sender: self)
6
  • can you show the code you wrote to push this controller? Commented Nov 20, 2019 at 20:17
  • i have updated my question Commented Nov 20, 2019 at 20:27
  • Make sure the Segue kind is "Show" not "Present Modally". Can you check? Commented Nov 20, 2019 at 20:30
  • yep it is set to show Commented Nov 20, 2019 at 20:37
  • the screen is being presented from left to right or from the bottom? Commented Nov 20, 2019 at 20:51

1 Answer 1

1

If your current View controller is showing the navigation bar but the next controller is not, then these could be the possible cases:

  1. You are presenting the controller instead of pushing it to navigation stack.
  2. If you are using segue, you might have selected Segue kind as "Present Modally" instead of "Show"
  3. Your current view controller viewWillDisapper function says navigationController?.navigationBar.isHidden = true which hides the navigation bar as soon as the current view disappears.
  4. Your destination view controller is hiding the navigation bar somewhere in code.
  5. Your CurrentViewController is not embedded in a NavigationController.
Sign up to request clarification or add additional context in comments.

1 Comment

you were right, it was in view will appear method thank you

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.