let autocompleteController = GMSAutocompleteViewController()
autocompleteController.autocompleteFilter?.country = "AU"
autocompleteController.delegate = self
self.presentViewController(autocompleteController, animated: true, completion: nil)
I need only filter data for Australia so I want to filter data by country.
The autocompleteFilter property is nil by default, so the line
autocompleteController.autocompleteFilter?.country = "AU"
doesn't do anything. Do it like this instead:
let filter = GMSAutocompleteFilter()
filter.country = "AU"
autocompleteController.autocompleteFilter = filter
GMSAutocompleteViewController *controller = [[GMSAutocompleteViewController alloc]init];
GMSAutocompleteFilter *filter = [[GMSAutocompleteFilter alloc]init];
controller.delegate = self;
filter.country = @"IN";
controller.autocompleteFilter = filter;
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With