title: iOS 11 show searchBar in navigation bar next to leftBarButtonItem
body: <p>I am trying to get the new iOS-11 searchBar approach to work, but don't manage. The searchBar shows up, but is shown below the left bar button, instead of next to it:</p>
  
  <p><a href="https://i.stack.imgur.com/8RN7J.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/8RN7J.png" alt="enter image description here"></a></p>
  
  <p>It is the same in landscape mode. 
  The code that I am using is:</p>
  
  <pre><code>self.searchResults = [[SearchResultsTable alloc] init];
  self.searchResults.delegate = self;
  searchController = [[UISearchController alloc] initWithSearchResultsController:self.searchResults];
  searchController.searchResultsUpdater = self.searchResults;
  searchController.hidesNavigationBarDuringPresentation = NO;
  self.definesPresentationContext = YES;
  
  self.navigationItem.leftBarButtonItem = [[UIBarButtonItem alloc]
      initWithBarButtonSystemItem:UIBarButtonSystemItemRefresh
                           target:self
                           action:@selector(swapToListView:)];
  if ([self.navigationItem respondsToSelector:@selector(setSearchController:)]) {
      // only available from IOS-11 onwards
      self.navigationItem.title = nil;
      self.navigationItem.titleView = nil;
      [self.navigationItem setSearchController:searchController];
  
  } else {
      // Fallback on earlier versions
      self.navigationItem.titleView = searchController.searchBar;
  }
  </code></pre>
  
  <p>The old code works fine on pre-iOS-11 systems, but has other problems on iOS-11, so I prefer to use the new approach. 
  Anybody knows what I am doing wrong here?</p>