title: Why is title not showing in Navigation bar? Swift 3
body: <p>The titles in the <code>DetailViewController</code> and <code>RootController1</code> do not show. Also when back button is pressed in <code>DetailViewController</code>, it pops to <code>RearTV</code> instead of popping to <code>RootController1</code>. Can anyone tell me how to customize the titles of the navigation bar shown on UIViewControllers?</p>
  
  <ol>
  <li><p>Initial ViewController is of type SWRevealViewController</p></li>
  <li><p>Custom segue from SWRevealViewController to NavigationController</p></li>
  <li><p>From the Navigation Controller to RearTV (a UITableViewController with static cells holding several buttons) there is a relationship of "root view controller to RearTV"  </p></li>
  <li><p>From a button on RearTV to VC2 (a UIViewController having an embed container view placed on top of it) there is "Show" segue to VC2</p></li>
  <li><p>From the container View in a VC2 there is an Embed Segue to  "Split View Controller"</p></li>
  </ol>
  
  <p>5.1 From the split view controller to Navigation Controller (the one to the right) there is a relationship of "master view controller to Navigation Controller"    </p>
  
  <p>5.1.2 From the Navigation Controller (the one to the right) to the root controller there is a relationship of "root view controller to Root Controller1" </p>
  
  <p>5.1.3 From the root controller (named "Root Controller1") to Navigation Controller ("the one underneath) there is a segue "showDetail1 to Navigation Controller"</p>
  
  <p>5.2 From the split view controller to navigation controller ("the one underneath) there is a relationship "detail view controller to Navigation Controller"    </p>
  
  <ol start="6">
  <li>From the navigation controller ("the one underneath)  to Detail View Controller there is a segue "root view controller to Detail View Controller". </li>
  </ol>
  
  <p>Both in RootController1 and DetailViewController I am trying to show a title, but it shows nothing.</p>
  
  <pre><code>//centers the title of the navigation bar in all view controllers
  struct CustomNavBar {
  static func center(title: String) -&gt; UILabel {
      let titleLabel = UILabel(frame: CGRect(x: 0, y: 0, width: 40, height: 40))
      titleLabel.text = title
      titleLabel.adjustsFontSizeToFitWidth = true
      titleLabel.textAlignment = NSTextAlignment.center
      return titleLabel
    }
  }
  
    override func viewDidLoad() {
        super.viewDidLoad()
  
       //attempt 1 to customize title of navigation bar
       self.navigationController?.navigationItem.titleView =  CustomNavBar.center(title: "some title")
  
       //attempt 2 to customize title of navigation bar
             self.navigationItem.titleView =  CustomNavBar.center(title: "some title")
  }
  </code></pre>
  
  <p>//firstImage <a href="https://i.stack.imgur.com/BRIv7.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/BRIv7.png" alt="first"></a></p>
  
  <p>//secondImage <a href="https://i.stack.imgur.com/qNBU0.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/qNBU0.png" alt="second"></a></p>
  
  <p>//thirdImage <a href="https://i.stack.imgur.com/4Wnjf.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/4Wnjf.png" alt="third"></a></p>