1

Goal

I want to make my search box auto-complete detecting place name and address.

Currently, my search box auto-complete detecting only the address.

I used this one in my iOS app. Result is looking good for addresses but not place name.

https://github.com/shmidt/GooglePlacesSearchController

enter image description here

I want it to detect places, like B&H Photo in NYC and so on ?

Example what I'm trying to do

enter image description here

Is it a paid service that I need to enable on Google API Console Library ?

Can someone sheds some lights on this ?

Community
  • 1
  • 1
code-8
  • 54,650
  • 106
  • 352
  • 604

1 Answers1

1

Just change your GooglePlacesSearchController initialization parameter placeType to .noFilter

let controller = GooglePlacesSearchController(
    delegate: self, apiKey: GoogleMapsAPIServerKey, placeType: .noFilter)

For anyone with the same question but different implementation , just add a filter to your GMSAutocompleteViewController

let autocompleteController = GMSAutocompleteViewController()
autocompleteController.delegate = self

// Specify a filter.
let filter = GMSAutocompleteFilter()
filter.type = .noFilter
autocompleteController.autocompleteFilter = filter
Ely Dantas
  • 705
  • 11
  • 23