title: BarButtonItem Doesn't Show button after added
body: <p>I want custom navigation item as <code>facebook</code> app.
  Have two buttons and one <code>UISearchBar</code>. Buttons is <code>leftBarButtonItem</code> and <code>rightBarButtonItem</code>. <code>UISearchBar</code> is <code>titleView</code>. 
  to make searchbar in titleview become wide i removed two buttons by set it to nil as image below. and i add two buttons again when <code>searchBarCancelButton</code> clicked but the  buttons  doesn't shown. 
  Could u help me ?  <a href="https://i.stack.imgur.com/PVGlF.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/PVGlF.jpg" alt="enter image description here"></a></p>
  
  <p>when click <code>searchBarCancelButton</code> i want it to show as below 
  <a href="https://i.stack.imgur.com/LpFIe.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/LpFIe.png" alt="enter image description here"></a></p>
  
  <p>Code I have try:</p>
  
  <pre><code>func updateSearchResultsForSearchController(searchController: UISearchController) {
      if navigationItem.rightBarButtonItem != nil {
          self.navigationItem.rightBarButtonItem = nil 
          self.navigationItem.leftBarButtonItem = nil
      }
  }
  
  func searchBarCancelButtonClicked(searchBar: UISearchBar) {
      navigationItem.setLeftBarButtonItem(getBarButtonItem("info", buttonfor: "left"), animated: false)
      navigationItem.setRightBarButtonItem(getBarButtonItem("more_‌​icon", buttonfor: "right"), animated: false)
  }
  
  extension MainviewCtrl : UISearchResultsUpdating {
  func updateSearchResultsForSearchController(searchController: UISearchController) {
  
      if navigationItem.rightBarButtonItem != nil {
          self.navigationItem.rightBarButtonItem = nil
          self.navigationItem.leftBarButtonItem  = nil
      }
  }
  }
  
  extension MainviewCtrl : UISearchBarDelegate    {
  
  func searchBarCancelButtonClicked(searchBar: UISearchBar) {
      navigationItem.setLeftBarButtonItem(getBarButtonItem("info", buttonfor: "left"), animated: false)
      navigationItem.setRightBarButtonItem(getBarButtonItem("more_icon", buttonfor: "right"), animated: false)
  }
  }
  
  class MainviewCtrl: UIViewController , UISearchControllerDelegate {
  
  lazy var searchController : UISearchController = {
  
      let _searchController = UISearchController(searchResultsController: nil)
      _searchController.searchResultsUpdater = self
      _searchController.dimsBackgroundDuringPresentation = false
      _searchController.hidesNavigationBarDuringPresentation = false
      _searchController.searchBar.delegate   = self
      _searchController.searchBar.tintColor = UIColor.whiteColor()
      _searchController.searchBar.searchBarStyle = UISearchBarStyle.Minimal
      var textFieldInsideSearchBar = _searchController.searchBar.valueForKey("searchField") as? UITextField
      textFieldInsideSearchBar?.textColor = UIColor.whiteColor()
      return _searchController
  }()
  
  override func viewDidLoad() {
      super.viewDidLoad()
      navigationItem.titleView   = searchController.searchBar
      definesPresentationContext = true
      addBarButtonItems()
  }
  func addBarButtonItems(){
      navigationItem.leftBarButtonItem  = getBarButtonItem("info", buttonfor: "left")
      navigationItem.rightBarButtonItem = getBarButtonItem("more_icon", buttonfor: "right")
  }
  func getBarButtonItem(imagename : String , buttonfor : String)-&gt; UIBarButtonItem!{
      let image = (UIImage(named: imagename))!.imageWithRenderingMode(UIImageRenderingMode.AlwaysOriginal)
      switch buttonfor.lowercaseString {
      case "left":
          return (UIBarButtonItem(image: image, style: UIBarButtonItemStyle.Plain, target: self, action: #selector(MainviewCtrl.infoAction)))
      case "right":
          return (UIBarButtonItem(image: image, style: UIBarButtonItemStyle.Plain, target: self, action: #selector(MainviewCtrl.moreAction)))
      default : break ;
      }
      return UIBarButtonItem()
  }
  </code></pre>