PerNil
PerNil

Reputation: 187

NavigationBar is not showing

I have embedded some ViewControllers in a UINavigationController But the backButton/navigationBar is not showing. In the second ViewController the navigationBar is shoving in StoryBoard, but not appearing in simulator, and in the third ViewController the navigationBar is not showing at all. Why is this happening?

enter image description here

EDIT

I use prepareForSegue to send data to the next ViewController. I don't know if that matters..

 func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) {
     performSegue(withIdentifier: "ToListVCSegue", sender: self)

    }   


 override func prepare(for segue: UIStoryboardSegue, sender: Any?)
        {
            if segue.identifier == "ToListVCSegue"
            {

                let destination = segue.destination as! ListLocationViewController
                if let indexPath = tableView.indexPathForSelectedRow{
                  destination.listID = listID[indexPath.row]

                }

Upvotes: 0

Views: 60

Answers (2)

Shkelzen
Shkelzen

Reputation: 178

You have to check options on the Inspector view for your navigation controller and all view controllers pushed on it. navigation controller options

view controller options

Upvotes: 1

Abbas Sabeti
Abbas Sabeti

Reputation: 151

You probably connect thirdViewController with the secondViewController with a Storyboard Segue. Select that segue and in the Attributes Inspector, change the Kind to 'Show (e.g. Push)'enter image description here

Upvotes: 0

Related Questions