title: Google Places iOS Autocomplete results space
body: <p>I tried to use Googles Autocomplete API and I used this tutorial:
  <a href="https://developers.google.com/places/ios-sdk/autocomplete#add_a_search_bar_to_the_top_of_a_view" rel="nofollow noreferrer">https://developers.google.com/places/ios-sdk/autocomplete#add_a_search_bar_to_the_top_of_a_view</a></p>
  
  <p>My viewDidLoad method contains this:</p>
  
  <pre><code>[super viewDidLoad];
  // google autocomplete
  _resultsViewController = [[GMSAutocompleteResultsViewController alloc] init];
  _resultsViewController.delegate = self;
  [_resultsViewController setExtendedLayoutIncludesOpaqueBars:YES];
  
  _searchController = [[UISearchController alloc]
                       initWithSearchResultsController:_resultsViewController];
  _searchController.searchResultsUpdater = _resultsViewController;
  
  [_searchController setDelegate:self];
  
  // When UISearchController presents the results view, present it in
  // this view controller, not one further up the chain.
  self.definesPresentationContext = YES;
  
  // Prevent the navigation bar from being hidden when searching.
  _searchController.hidesNavigationBarDuringPresentation = NO;
  
  self.navigationController.navigationBar.translucent = NO;
  _searchController.hidesNavigationBarDuringPresentation = NO;
  
  self.extendedLayoutIncludesOpaqueBars = YES;
  self.edgesForExtendedLayout = UIRectEdgeTop;
  [_searchBarContainerView addSubview:_searchController.searchBar];
  
  [_searchController setActive:YES];
  </code></pre>
  
  <p>But it's showing results like on the image. How can I remove the space from between the results and the searchbar?
  <a href="https://i.stack.imgur.com/nqLtq.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/nqLtq.png" alt="enter image description here"></a></p>