title: How display UISearchBar in UINavigation?
body: <p>I have search icon in navigation bar, and UISearchBar in TableViewHeader.
  I want to hide UISearchBar but show and hide when:</p>
  
  <p><strong>UISearchbar show</strong>: Clicked on the search icon, then eliminate navigation and show it. </p>
  
  <p><strong>UISearchBar hide</strong>: Press cancel to hide search and display navigation back.</p>
  
  <p>Please help me!!</p>
  
  <p>Thank.</p>
  
  <p><img src="https://i.stack.imgur.com/Pptuj.jpg" alt=""></p>
  
  <p>This is what I have done so far.</p>
  
  <pre><code>- (void) viewDidload{
  
  self.searchBar = [[UISearchBar alloc] initWithFrame:CGRectZero];
          self.searchBar.placeholder = @"Search";
  self.searchBar.delegate = self;
  
  [self.searchBar sizeToFit];
  
  self.strongSearchDisplayController = [[UISearchDisplayController alloc] initWithSearchBar:self.searchBar contentsController:self];
  self.searchDisplayController.searchResultsDataSource = self;
  self.searchDisplayController.searchResultsDelegate = self;
  self.searchDisplayController.delegate = self;
  
  self.tableView.tableHeaderView = self.searchBar;
  
  
  _btnSearch = [UIButton buttonWithType:UIButtonTypeCustom];
  _btnSearch.frame = CGRectMake(0, 0, 22, 22);
  [_btnSearch setImage:[UIImage imageNamed:@"search_btn.png"] forState:UIControlStateNormal];
  [_btnSearch addTarget:self action:@selector(showSearch:) forControlEvents:UIControlEventTouchUpInside];
  UIBarButtonItem *searchItem = [[UIBarButtonItem alloc] initWithCustomView:_btnSearch];
  
  self.navigationItem.rightBarButtonItems = _btnSearch;
  }
  </code></pre>
  
  <p>This is my action when click on the iCon search</p>
  
  <pre><code>- (IBAction)showSearch:(id)sender{
      [self.searchBar becomeFirstResponder];
  }
  </code></pre>
  
  <p>I don't want to place my search in tableView and how still I can display UISearchBar when click on search icon?</p>
  
  <p><strong>Another question:</strong> when I call [self.searchBar becomeFirstResponder]; it's doesn't work good. The cancel button doesn't work at all.</p>
  
  <p>Please kindly help me.</p>