title: Add UISearchController on a navigation bar iOS
body: <p>I am not able to add UISearch Controller on a navigation bar iOS 9.. There are many on the internet but none of them works..</p>
  
  <p>The code is..</p>
  
  <pre><code>- (void)viewDidLoad {
      [super viewDidLoad];
      // Do any additional setup after loading the view, typically from a nib.
  
      searchController = [[UISearchController alloc] initWithSearchResultsController:nil];
      searchController.searchResultsUpdater = self;
      searchController.delegate = self;
      searchController.searchBar.delegate = self;
      searchController.hidesNavigationBarDuringPresentation = NO;
      searchController.dimsBackgroundDuringPresentation = YES;
  
      self.navigationItem.titleView = searchController.searchBar;
  
      self.definesPresentationContext = YES;
  
  }
  
  -(void)updateSearchResultsForSearchController:(UISearchController *)searchController{}
  </code></pre>