Search code examples
iosgoogle-places-apigmsautocomplete

GMSAutocompleteViewController want to get text which is in searchbar on search click


Hi i have used GMSAutocompleteViewController full-screen control. https://developers.google.com/places/ios-api/autocomplete#add_an_autocomplete_ui_control

i am not able to get keyboard search click event tried by searchbar event and textfieldshouldreturn event but it is not called. i want to get text which i have typed when any location not found in google.


Solution

  • From the Google Places API documentation..

    https://developers.google.com/places/ios-api/autocomplete#add_an_autocomplete_ui_control

    Use a results controller when you want more control over the text input UI

    You can not access search bar if you are using GMSAutocompleteViewController. You have to use GMSAutocompleteResultsViewController.