title: Can I do a location search in Swift without using the map?
body: <p>What I'm trying to create in Swift 3.0 is a simple location search, based on current location (or a specified one), for a predefined range (e.g. 100 km). I don't want any results that are outside of that range. I don't want to see the map, put any pins on it, etc. Just want the search, and then return the result. Is this possible with mapkit? Every example or tutorial I have found starts with the map and uses the map to get the region/span, then returns to the map with the result. In trying out some of those examples, the search is not restricted to the map region, as I'm getting results in other countries. What I want is a single screen search that simply returns a selected location. No map. No results from the other side of the world. Should I be using something other than mapkit or can I accomplish this without the mapview?</p>
  
  <p>Edit:
  With the info provided by @Rob, I'm up to here...</p>
  
  <pre><code>extension LocationSearchTable : UISearchResultsUpdating {
  
      func updateSearchResults(for searchController: UISearchController) {
          var localRegion: MKCoordinateRegion
          let distance: CLLocationDistance = 1200
  
          let currentLocation = CLLocationCoordinate2D.init(latitude: 50.412165, longitude: -104.66087)
  
          localRegion = MKCoordinateRegionMakeWithDistance(currentLocation, distance, distance)
  
          print(localRegion)
  
          guard let searchBarText = searchController.searchBar.text else { return }
  
          let request = MKLocalSearchRequest()
          request.naturalLanguageQuery = searchBarText
          request.region = localRegion
          let search = MKLocalSearch(request: request)
  
          search.start { response, _ in
              guard let response = response else {
                  return
              }
              self.matchingItems = response.mapItems
              self.tableView.reloadData()
          }
      }
  }
  </code></pre>
  
  <p>However, I'm still a bit confused. It still seems to bring up results from all over. For example, if I was looking for the address 19 Rendek Crescent based on a location in Regina, SK, here are the results as I type:</p>
  
  <p><a href="https://i.stack.imgur.com/GACYw.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/GACYw.png" alt="enter image description here"></a></p>
  
  <p><a href="https://i.stack.imgur.com/tWXKi.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/tWXKi.png" alt="enter image description here"></a></p>
  
  <p><a href="https://i.stack.imgur.com/zXnXy.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/zXnXy.png" alt="enter image description here"></a></p>
  
  <p><a href="https://i.stack.imgur.com/tsxSr.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/tsxSr.png" alt="enter image description here"></a></p>
  
  <p><a href="https://i.stack.imgur.com/xpKZz.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/xpKZz.png" alt="enter image description here"></a></p>
  
  <p>Why is it returning locations outside of Regina, and why do Rae St and Read Ave come up before Rendek does?</p>