AI-generated Key Takeaways
-
The
GMSAutocompleteFetcherDelegate
protocol handles callbacks fromGMSAutocompleteFetcher
. -
It provides methods to receive autocomplete predictions or error messages during the autocomplete process.
-
didAutocompleteWithPredictions:
is called when predictions are available, providing an array ofGMSAutocompletePrediction
objects. -
didFailAutocompleteWithError:
is called if an error occurs during the autocomplete request, providing anNSError
object.
GMSAutocompleteFetcherDelegate
Deprecated
Use GMSPlacesClient#fetchAutocompleteSuggestionsFromRequest:callback:
instead.
@protocol GMSAutocompleteFetcherDelegate <NSObject>
@required
/**
* Called when autocomplete predictions are available.
*
* @param predictions an array of `GMSAutocompletePrediction` objects.
*/
- (void)didAutocompleteWithPredictions:(NSArray<GMSAutocompletePrediction *> *)predictions
__GMS_AVAILABLE_BUT_DEPRECATED_MSG(
"Use <code>GMSPlacesClient#fetchAutocompleteSuggestionsFromRequest:callback:</code> "
"instead.")
;
/**
* Called when an autocomplete request returns an error.
*
* @param error the error that was received.
*/
- (void)didFailAutocompleteWithError:(NSError *)error
__GMS_AVAILABLE_BUT_DEPRECATED_MSG(
"Use <code>GMSPlacesClient#fetchAutocompleteSuggestionsFromRequest:callback:</code> "
"instead.")
;
@end
-
Deprecated
Use
GMSPlacesClient#fetchAutocompleteSuggestionsFromRequest:callback:
instead.Called when autocomplete predictions are available.
Declaration
Swift
func didAutocomplete(with predictions: [GMSAutocompletePrediction])
Objective-C
- (void)didAutocompleteWithPredictions: (nonnull NSArray<GMSAutocompletePrediction *> *)predictions;
Parameters
predictions
an array of
GMSAutocompletePrediction
objects. -
Deprecated
Use
GMSPlacesClient#fetchAutocompleteSuggestionsFromRequest:callback:
instead.Called when an autocomplete request returns an error.
Declaration
Swift
func didFailAutocompleteWithError(_ error: any Error)
Objective-C
- (void)didFailAutocompleteWithError:(nonnull NSError *)error;
Parameters
error
the error that was received.