<GMSAutocompleteViewControllerDelegate> Protocol Reference

<GMSAutocompleteViewControllerDelegate> Protocol Reference

Overview

Protocol used by GMSAutocompleteViewController, to communicate the user's interaction with the controller to the application.

Public Member Functions

(void) - viewController:didAutocompleteWithPlace:
 Called when a place has been selected from the available autocomplete predictions.
(void) - viewController:didFailAutocompleteWithError:
 Called when a non-retryable error occurred when retrieving autocomplete predictions or place details.
(void) - wasCancelled:
 Called when the user taps the Cancel button in a GMSAutocompleteViewController.
(BOOL) - viewController:didSelectPrediction:
 Called when the user selects an autocomplete prediction from the list but before requesting place details.
(void) - didUpdateAutocompletePredictions:
 Called once every time new autocomplete predictions are received.
(void) - didRequestAutocompletePredictions:
 Called once immediately after a request for autocomplete predictions is made.

Member Function Documentation

- (void) viewController: (GMSAutocompleteViewController *)  viewController
didAutocompleteWithPlace: (GMSPlace *)  place 
[required]

Called when a place has been selected from the available autocomplete predictions.

Implementations of this method should dismiss the view controller as the view controller will not dismiss itself.

Parameters:
viewControllerThe GMSAutocompleteViewController that generated the event.
placeThe GMSPlace that was returned.
- (void) viewController: (GMSAutocompleteViewController *)  viewController
didFailAutocompleteWithError: (NSError *)  error 
[required]

Called when a non-retryable error occurred when retrieving autocomplete predictions or place details.

A non-retryable error is defined as one that is unlikely to be fixed by immediately retrying the operation.

Only the following values of GMSPlacesErrorCode are retryable:

  • kGMSPlacesNetworkError
  • kGMSPlacesServerError
  • kGMSPlacesInternalError

All other error codes are non-retryable.

Parameters:
viewControllerThe GMSAutocompleteViewController that generated the event.
errorThe NSError that was returned.
- (void) wasCancelled: (GMSAutocompleteViewController *)  viewController [required]

Called when the user taps the Cancel button in a GMSAutocompleteViewController.

Implementations of this method should dismiss the view controller as the view controller will not dismiss itself.

Parameters:
viewControllerThe GMSAutocompleteViewController that generated the event.
- (BOOL) viewController: (GMSAutocompleteViewController *)  viewController
didSelectPrediction: (GMSAutocompletePrediction *)  prediction 
[optional]

Called when the user selects an autocomplete prediction from the list but before requesting place details.

Returning NO from this method will suppress the place details fetch and didAutocompleteWithPlace will not be called.

Parameters:
viewControllerThe GMSAutocompleteViewController that generated the event.
predictionThe GMSAutocompletePrediction that was selected.
- (void) didUpdateAutocompletePredictions: (GMSAutocompleteViewController *)  viewController [optional]

Called once every time new autocomplete predictions are received.

Parameters:
viewControllerThe GMSAutocompleteViewController that generated the event.
- (void) didRequestAutocompletePredictions: (GMSAutocompleteViewController *)  viewController [optional]

Called once immediately after a request for autocomplete predictions is made.

Parameters:
viewControllerThe GMSAutocompleteViewController that generated the event.