GooglePlaces Framework Reference
Stay organized with collections
Save and categorize content based on your preferences.
GMSAutocompleteTableDataSourceDelegate
@protocol GMSAutocompleteTableDataSourceDelegate <NSObject>
Protocol used by GMSAutocompleteTableDataSource
, to communicate the user’s interaction with the
data source to the application.
-
Called when a place has been selected from the available autocomplete predictions.
-
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
tableDataSource
|
|
error
|
The NSError that was returned.
|
-
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
tableDataSource
|
|
prediction
|
|
-
Called once every time new autocomplete predictions are received.
-
Called once immediately after a request for autocomplete predictions is made.
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\u003e\u003ccode\u003eGMSAutocompleteTableDataSourceDelegate\u003c/code\u003e helps communicate user interactions with the data source to the application.\u003c/p\u003e\n"],["\u003cp\u003eProvides methods to handle successful autocomplete results, errors, and prediction selections.\u003c/p\u003e\n"],["\u003cp\u003eIt includes optional methods to indicate the start and completion of autocomplete prediction requests.\u003c/p\u003e\n"],["\u003cp\u003e\u003ccode\u003etableDataSource\u003c/code\u003e is a common parameter across methods, representing the source of the event.\u003c/p\u003e\n"]]],["The `GMSAutocompleteTableDataSourceDelegate` protocol communicates user interactions with the `GMSAutocompleteTableDataSource`. Key actions include: notifying when a user selects a place via `didAutocompleteWithPlace:`, reporting errors via `didFailAutocompleteWithError:`, signaling a prediction selection via `didSelectPrediction:`, updating predictions via `didUpdateAutocompletePredictionsForTableDataSource:`, and indicating a new request for predictions with `didRequestAutocompletePredictionsForTableDataSource:`. Each method provides the `tableDataSource` and relevant data such as the selected place, error, or prediction.\n"],null,["# GooglePlaces Framework Reference\n\nGMSAutocompleteTableDataSourceDelegate\n======================================\n\n @protocol GMSAutocompleteTableDataSourceDelegate \u003cNSObject\u003e\n\nProtocol used by [GMSAutocompleteTableDataSource](../Classes/GMSAutocompleteTableDataSource.html), to communicate the user's interaction with the\ndata source to the application.\n- `\n ``\n ``\n `\n\n ### [-tableDataSource:didAutocompleteWithPlace:](#/c:objc(pl)GMSAutocompleteTableDataSourceDelegate(im)tableDataSource:didAutocompleteWithPlace:)\n\n `\n ` \n Called when a place has been selected from the available autocomplete predictions. \n\n #### Declaration\n\n Swift \n\n func tableDataSource(_ tableDataSource: ../Classes/GMSAutocompleteTableDataSource.html, didAutocompleteWith place: ../Classes/GMSPlace.html)\n\n Objective-C \n\n - (void)tableDataSource:\n (nonnull ../Classes/GMSAutocompleteTableDataSource.html *)tableDataSource\n didAutocompleteWithPlace:(nonnull ../Classes/GMSPlace.html *)place;\n\n #### Parameters\n\n |-------------------------|----------------------------------------------------------------------------------------------------------------|\n | ` `*tableDataSource*` ` | The [GMSAutocompleteTableDataSource](../Classes/GMSAutocompleteTableDataSource.html) that generated the event. |\n | ` `*place*` ` | The [GMSPlace](../Classes/GMSPlace.html) that was returned. |\n\n- `\n ``\n ``\n `\n\n ### [-tableDataSource:didFailAutocompleteWithError:](#/c:objc(pl)GMSAutocompleteTableDataSourceDelegate(im)tableDataSource:didFailAutocompleteWithError:)\n\n `\n ` \n Called when a non-retryable error occurred when retrieving autocomplete predictions or place\n details. A non-retryable error is defined as one that is unlikely to be fixed by immediately\n retrying the operation.\n\n\n Only the following values of [GMSPlacesErrorCode](../Enums/GMSPlacesErrorCode.html) are retryable:\n - kGMSPlacesNetworkError\n - kGMSPlacesServerError\n - kGMSPlacesInternalError\n\n All other error codes are non-retryable.\n\n \u003cbr /\u003e\n\n #### Declaration\n\n Swift \n\n func tableDataSource(_ tableDataSource: ../Classes/GMSAutocompleteTableDataSource.html, didFailAutocompleteWithError error: any Error)\n\n Objective-C \n\n - (void)tableDataSource:\n (nonnull ../Classes/GMSAutocompleteTableDataSource.html *)tableDataSource\n didFailAutocompleteWithError:(nonnull NSError *)error;\n\n #### Parameters\n\n |-------------------------|----------------------------------------------------------------------------------------------------------------|\n | ` `*tableDataSource*` ` | The [GMSAutocompleteTableDataSource](../Classes/GMSAutocompleteTableDataSource.html) that generated the event. |\n | ` `*error*` ` | The `NSError` that was returned. |\n\n- `\n ``\n ``\n `\n\n ### [-tableDataSource:didSelectPrediction:](#/c:objc(pl)GMSAutocompleteTableDataSourceDelegate(im)tableDataSource:didSelectPrediction:)\n\n `\n ` \n Called when the user selects an autocomplete prediction from the list but before requesting\n place details. Returning NO from this method will suppress the place details fetch and\n didAutocompleteWithPlace will not be called. \n\n #### Declaration\n\n Swift \n\n optional func tableDataSource(_ tableDataSource: ../Classes/GMSAutocompleteTableDataSource.html, didSelect prediction: ../Classes/GMSAutocompletePrediction.html) -\u003e Bool\n\n Objective-C \n\n - (BOOL)tableDataSource:\n (nonnull ../Classes/GMSAutocompleteTableDataSource.html *)tableDataSource\n didSelectPrediction:(nonnull ../Classes/GMSAutocompletePrediction.html *)prediction;\n\n #### Parameters\n\n |-------------------------|----------------------------------------------------------------------------------------------------------------|\n | ` `*tableDataSource*` ` | The [GMSAutocompleteTableDataSource](../Classes/GMSAutocompleteTableDataSource.html) that generated the event. |\n | ` `*prediction*` ` | The [GMSAutocompletePrediction](../Classes/GMSAutocompletePrediction.html) that was selected. |\n\n- `\n ``\n ``\n `\n\n ### [-didUpdateAutocompletePredictionsForTableDataSource:](#/c:objc(pl)GMSAutocompleteTableDataSourceDelegate(im)didUpdateAutocompletePredictionsForTableDataSource:)\n\n `\n ` \n Called once every time new autocomplete predictions are received. \n\n #### Declaration\n\n Swift \n\n optional func didUpdateAutocompletePredictions(for tableDataSource: ../Classes/GMSAutocompleteTableDataSource.html)\n\n Objective-C \n\n - (void)didUpdateAutocompletePredictionsForTableDataSource:\n (nonnull ../Classes/GMSAutocompleteTableDataSource.html *)tableDataSource;\n\n #### Parameters\n\n |-------------------------|----------------------------------------------------------------------------------------------------------------|\n | ` `*tableDataSource*` ` | The [GMSAutocompleteTableDataSource](../Classes/GMSAutocompleteTableDataSource.html) that generated the event. |\n\n- `\n ``\n ``\n `\n\n ### [-didRequestAutocompletePredictionsForTableDataSource:](#/c:objc(pl)GMSAutocompleteTableDataSourceDelegate(im)didRequestAutocompletePredictionsForTableDataSource:)\n\n `\n ` \n Called once immediately after a request for autocomplete predictions is made. \n\n #### Declaration\n\n Swift \n\n optional func didRequestAutocompletePredictions(for tableDataSource: ../Classes/GMSAutocompleteTableDataSource.html)\n\n Objective-C \n\n - (void)didRequestAutocompletePredictionsForTableDataSource:\n (nonnull ../Classes/GMSAutocompleteTableDataSource.html *)tableDataSource;\n\n #### Parameters\n\n |-------------------------|----------------------------------------------------------------------------------------------------------------|\n | ` `*tableDataSource*` ` | The [GMSAutocompleteTableDataSource](../Classes/GMSAutocompleteTableDataSource.html) that generated the event. |"]]