title: conditional showing of uitoolbar
body: <p>I have a <code>UIViewController</code> that is presented in two ways, either modally or pushed on top of a navigation controller stack. The <code>UIViewController</code> contains a <code>UITableView</code> and a <code>UIToolbar</code>. When presented modally, i needed a way of showing a <code>title</code> for the <code>ViewController</code>, so I added in another <code>UIToolbar</code>, <code>topToolbar</code>. My problem is, whenever I push the <code>UIViewController</code>, I don't need <code>topToolbar</code> anymore, since the <code>navigation tabbar</code> already shows the title. When I set <code>topToolbar</code>'s hidden property to <code>true</code>, however, my <code>UITableView</code> is not bound to the bottom of the <code>navigation tab bar</code> and there's space between the <code>UITableView</code> and the <code>navigation tabbar</code>, which doesn't look so good. I tried to call <code>removeFromSuperview()</code> on <code>topToolbar</code> instead of setting its <code>hidden</code> property to <code>true</code>, but that didn't work out, and <code>topToolbar</code> appeared under the <code>navigation bar</code>, and now i have two <code>titles</code> instead of one. Any idea on how this can be done? I can't add pictures, but here's my code for manipulating the appearance of the <code>UIViewController</code> based on whether it's presented modally or pushed on top of the navigation stack:</p>
  
  <pre><code> override func viewWillAppear(animated: Bool) {
      super.viewWillAppear(animated)
      if itemBought != nil {
          cart.items.append(itemBought!)
      }
  
      totalView.layer.borderColor = UIColor.grayColor().CGColor
      totalView.layer.borderWidth = 0.5
  
      totalLabel.text = "$" + String(format: "%.2f", cart.getTotal())
  
      if let navBar = self.navigationController?.navigationBar {
          //hide toolbar and tabbar
          topToolbar.removeFromSuperview()
          self.tabBarController?.tabBar.hidden = true
  
          //hide shop button
          var bottomItems: [UIBarButtonItem] = bottomToolbar.items as! [UIBarButtonItem]
          if let index = find(bottomItems, shopToolbarButton) {
              bottomItems.removeAtIndex(index)
          }
          bottomToolbar.items = bottomItems
      }
  }
  </code></pre>
  
  <p>I should also mention that i have a constraint on the <code>UITableView</code> that's basically: distance between <code>UItableView.top</code> and <code>Top Layout Guide.Bottom</code> is <code>&lt;=</code> to the height of <code>topToolbar</code>, which is 44. </p>
  
  <p>Any ideas?</p>