GooglePlaces Framework Reference

GMSAutocompleteTableDataSource

Deprecated

Use Places Swift SDK’s (https://developers.google.com/maps/documentation/places/ios-sdk/google-places-swift) placeAutocomplete API instead.


@interface GMSAutocompleteTableDataSource
    : NSObject <UITableViewDataSource, UITableViewDelegate>

GMSAutocompleteTableDataSource provides an interface for providing place autocomplete predictions to populate a UITableView by implementing the UITableViewDataSource and UITableViewDelegate protocols.

GMSAutocompleteTableDataSource is designed to be used as the data source for a UISearchDisplayController.

NOTE: UISearchDisplayController has been deprecated since iOS 8. It is now recommended to use UISearchController with GMSAutocompleteResultsViewController to display autocomplete results using the iOS search UI.

Set an instance of GMSAutocompleteTableDataSource as the searchResultsDataSource and searchResultsDelegate properties of UISearchDisplayController. In your implementation of shouldReloadTableForSearchString, call sourceTextHasChanged with the current search string.

Use the GMSAutocompleteTableDataSourceDelegate delegate protocol to be notified when a place is selected from the list. Because autocomplete predictions load asynchronously, it is necessary to implement didUpdateAutocompletePredictions and call reloadData on the UISearchDisplayController‘s table view.