GooglePlaces Framework Reference
Stay organized with collections
Save and categorize content based on your preferences.
GMSAutocompleteFetcherDelegate
@protocol GMSAutocompleteFetcherDelegate <NSObject>
Protocol for objects that can receive callbacks from GMSAutocompleteFetcher.
-
Called when autocomplete predictions are available.
-
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.
|
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2025-08-27 UTC.
[null,null,["Last updated 2025-08-27 UTC."],[[["\u003cp\u003eThe \u003ccode\u003eGMSAutocompleteFetcherDelegate\u003c/code\u003e protocol handles callbacks from \u003ccode\u003eGMSAutocompleteFetcher\u003c/code\u003e.\u003c/p\u003e\n"],["\u003cp\u003eIt provides methods to receive autocomplete predictions or error messages during the autocomplete process.\u003c/p\u003e\n"],["\u003cp\u003e\u003ccode\u003edidAutocompleteWithPredictions:\u003c/code\u003e is called when predictions are available, providing an array of \u003ccode\u003eGMSAutocompletePrediction\u003c/code\u003e objects.\u003c/p\u003e\n"],["\u003cp\u003e\u003ccode\u003edidFailAutocompleteWithError:\u003c/code\u003e is called if an error occurs during the autocomplete request, providing an \u003ccode\u003eNSError\u003c/code\u003e object.\u003c/p\u003e\n"]]],["The `GMSAutocompleteFetcherDelegate` protocol handles callbacks from `GMSAutocompleteFetcher`. It defines two key methods: `didAutocompleteWithPredictions:`, which is called when autocomplete predictions are available and provides an array of `GMSAutocompletePrediction` objects; and `didFailAutocompleteWithError:`, which is invoked when an autocomplete request encounters an error, passing the received error as a parameter. These methods enable the delegate to manage successful prediction retrieval and error handling.\n"],null,["# GooglePlaces Framework Reference\n\nGMSAutocompleteFetcherDelegate\n==============================\n\n @protocol GMSAutocompleteFetcherDelegate \u003cNSObject\u003e\n\nProtocol for objects that can receive callbacks from GMSAutocompleteFetcher.\n- `\n ``\n ``\n `\n\n ### [-didAutocompleteWithPredictions:](#/c:objc(pl)GMSAutocompleteFetcherDelegate(im)didAutocompleteWithPredictions:)\n\n `\n ` \n Called when autocomplete predictions are available. \n\n #### Declaration\n\n Swift \n\n func didAutocomplete(with predictions: [../Classes/GMSAutocompletePrediction.html])\n\n Objective-C \n\n - (void)didAutocompleteWithPredictions:\n (nonnull NSArray\u003c../Classes/GMSAutocompletePrediction.html *\u003e *)predictions;\n\n #### Parameters\n\n |---------------------|---------------------------------------------------------------------------------------------|\n | ` `*predictions*` ` | an array of [GMSAutocompletePrediction](../Classes/GMSAutocompletePrediction.html) objects. |\n\n- `\n ``\n ``\n `\n\n ### [-didFailAutocompleteWithError:](#/c:objc(pl)GMSAutocompleteFetcherDelegate(im)didFailAutocompleteWithError:)\n\n `\n ` \n Called when an autocomplete request returns an error. \n\n #### Declaration\n\n Swift \n\n func didFailAutocompleteWithError(_ error: any Error)\n\n Objective-C \n\n - (void)didFailAutocompleteWithError:(nonnull NSError *)error;\n\n #### Parameters\n\n |---------------|------------------------------|\n | ` `*error*` ` | the error that was received. |"]]