Reputation: 11
I implemented GMSAutocompleteTableDataSourceDelegate for my project. I see the data is loading based on the search result. However, when I click on the result its corresponding delegate method is not getting called.
Following delegate methods are getting called
func didRequestAutocompletePredictions(for tableDataSource: GMSAutocompleteTableDataSource) { UIApplication.shared.isNetworkActivityIndicatorVisible = true resultsController?.tableView.reloadData() } func didUpdateAutocompletePredictions(for tableDataSource: GMSAutocompleteTableDataSource) { UIApplication.shared.isNetworkActivityIndicatorVisible = false resultsController?.tableView.reloadData() }
After the selecting the address from the suggestion, ideally it is supposed to call one of the following methods. However, none of the methods are getting called.
func tableDataSource(_ tableDataSource: GMSAutocompleteTableDataSource, didAutocompleteWith place: GMSPlace) { } func tableDataSource(_ tableDataSource: GMSAutocompleteTableDataSource, didFailAutocompleteWithError error: Error) { } func tableDataSource(_ tableDataSource: GMSAutocompleteTableDataSource, didSelect prediction: GMSAutocompletePrediction) -> Bool { return true }
It will be great if, somebody can give me some idea how to tackle it or some debugging tips
Upvotes: 0
Views: 515
Reputation: 11
I found the problem. The reason was there was a UIGesture delegate for the view. Because of this delegate method, it was canceling all the events.
Upvotes: 1