Search Bar AutoComplete by Address and Place Name - Swift 4

1.1k Views Asked by At

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 ?

1

There are 1 best solutions below

0
On

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