GooglePlaces Framework Reference
Stay organized with collections
Save and categorize content based on your preferences.
GMSAutocompleteResultsViewController
@interface GMSAutocompleteResultsViewController
: UIViewController <UISearchResultsUpdating>
GMSAutocompleteResultsViewController
provides an interface that displays place autocomplete
predictions in a table view. The table view will be automatically updated as input text
changes.
This class is intended to be used as the search results controller of a UISearchController. Pass
an instance of GMSAutocompleteResultsViewController
to UISearchController’s
initWithSearchResultsController method, then set the controller as the UISearchController’s
searchResultsUpdater property.
Use the GMSAutocompleteResultsViewControllerDelegate
delegate protocol to be notified when a
place is selected from the list.
-
Delegate to be notified when a place is selected.
-
Filter to apply to autocomplete suggestions (can be nil).
-
The background color of table cells.
Declaration
Swift
var tableCellBackgroundColor: UIColor { get set }
Objective-C
@property (nonatomic, strong) UIColor *_Nonnull tableCellBackgroundColor;
-
The color of the separator line between table cells.
Declaration
Swift
var tableCellSeparatorColor: UIColor { get set }
Objective-C
@property (nonatomic, strong) UIColor *_Nonnull tableCellSeparatorColor;
-
The color of result name text in autocomplete results
Declaration
Swift
var primaryTextColor: UIColor { get set }
Objective-C
@property (nonatomic, strong) UIColor *_Nonnull primaryTextColor;
-
The color used to highlight matching text in autocomplete results
Declaration
Swift
var primaryTextHighlightColor: UIColor { get set }
Objective-C
@property (nonatomic, strong) UIColor *_Nonnull primaryTextHighlightColor;
-
The color of the second row of text in autocomplete results.
Declaration
Swift
var secondaryTextColor: UIColor { get set }
Objective-C
@property (nonatomic, strong) UIColor *_Nonnull secondaryTextColor;
-
The tint color applied to controls in the Autocomplete view.
Declaration
Swift
var tintColor: UIColor? { get set }
Objective-C
@property (nonatomic, strong, nullable) UIColor *tintColor;
-
Specify array of place property names to fetch for object GMSPlace
. Defaults to returning all
details if not overridden.
Declaration
Swift
var placeProperties: [String] { get set }
Objective-C
@property (nonatomic, strong) NSArray<NSString *> *_Nonnull placeProperties;
-
Specify individual place details to fetch for object GMSPlace
. Defaults to returning all
details if not overridden.
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\u003eGMSAutocompleteResultsViewController\u003c/code\u003e displays place autocomplete predictions in a table view, updating automatically with text input changes.\u003c/p\u003e\n"],["\u003cp\u003eIt's designed to be the search results controller for a \u003ccode\u003eUISearchController\u003c/code\u003e, handling place selection through the \u003ccode\u003eGMSAutocompleteResultsViewControllerDelegate\u003c/code\u003e.\u003c/p\u003e\n"],["\u003cp\u003eDevelopers can customize the appearance, including table cell colors, text colors, and a tint color for controls.\u003c/p\u003e\n"],["\u003cp\u003eFiltering of autocomplete suggestions is possible using the \u003ccode\u003eautocompleteFilter\u003c/code\u003e property.\u003c/p\u003e\n"],["\u003cp\u003eControl the details fetched for selected places by setting \u003ccode\u003eplaceProperties\u003c/code\u003e or \u003ccode\u003eplaceFields\u003c/code\u003e to retrieve specific information.\u003c/p\u003e\n"]]],["`GMSAutocompleteResultsViewController` displays place autocomplete predictions in a table view, updating as text changes. It's used with `UISearchController` by setting it as the `searchResultsController` and `searchResultsUpdater`. Key actions include setting a delegate to handle place selections, applying filters to suggestions, and customizing table cell and text colors. You can also specify place properties or fields to retrieve and customize the view's tint color.\n"],null,["# GooglePlaces Framework Reference\n\nGMSAutocompleteResultsViewController\n====================================\n\n @interface GMSAutocompleteResultsViewController\n : UIViewController \u003cUISearchResultsUpdating\u003e\n\n`GMSAutocompleteResultsViewController` provides an interface that displays place autocomplete\npredictions in a table view. The table view will be automatically updated as input text\nchanges.\n\nThis class is intended to be used as the search results controller of a UISearchController. Pass\nan instance of `GMSAutocompleteResultsViewController` to UISearchController's\ninitWithSearchResultsController method, then set the controller as the UISearchController's\nsearchResultsUpdater property.\n\nUse the [GMSAutocompleteResultsViewControllerDelegate](../Protocols/GMSAutocompleteResultsViewControllerDelegate.html) delegate protocol to be notified when a\nplace is selected from the list.\n- `\n ``\n ``\n `\n\n ### [delegate](#/c:objc(cs)GMSAutocompleteResultsViewController(py)delegate)\n\n `\n ` \n Delegate to be notified when a place is selected. \n\n #### Declaration\n\n Swift \n\n weak var delegate: (any ../Protocols/GMSAutocompleteResultsViewControllerDelegate.html)? { get set }\n\n Objective-C \n\n @property (nonatomic, weak, nullable) id\u003c../Protocols/GMSAutocompleteResultsViewControllerDelegate.html\u003e delegate;\n\n- `\n ``\n ``\n `\n\n ### [autocompleteFilter](#/c:objc(cs)GMSAutocompleteResultsViewController(py)autocompleteFilter)\n\n `\n ` \n Filter to apply to autocomplete suggestions (can be nil). \n\n #### Declaration\n\n Swift \n\n var autocompleteFilter: ../Classes/GMSAutocompleteFilter.html? { get set }\n\n Objective-C \n\n @property (nonatomic, strong, nullable) ../Classes/GMSAutocompleteFilter.html *autocompleteFilter;\n\n- `\n ``\n ``\n `\n\n ### [tableCellBackgroundColor](#/c:objc(cs)GMSAutocompleteResultsViewController(py)tableCellBackgroundColor)\n\n `\n ` \n The background color of table cells. \n\n #### Declaration\n\n Swift \n\n var tableCellBackgroundColor: UIColor { get set }\n\n Objective-C \n\n @property (nonatomic, strong) UIColor *_Nonnull tableCellBackgroundColor;\n\n- `\n ``\n ``\n `\n\n ### [tableCellSeparatorColor](#/c:objc(cs)GMSAutocompleteResultsViewController(py)tableCellSeparatorColor)\n\n `\n ` \n The color of the separator line between table cells. \n\n #### Declaration\n\n Swift \n\n var tableCellSeparatorColor: UIColor { get set }\n\n Objective-C \n\n @property (nonatomic, strong) UIColor *_Nonnull tableCellSeparatorColor;\n\n- `\n ``\n ``\n `\n\n ### [primaryTextColor](#/c:objc(cs)GMSAutocompleteResultsViewController(py)primaryTextColor)\n\n `\n ` \n The color of result name text in autocomplete results \n\n #### Declaration\n\n Swift \n\n var primaryTextColor: UIColor { get set }\n\n Objective-C \n\n @property (nonatomic, strong) UIColor *_Nonnull primaryTextColor;\n\n- `\n ``\n ``\n `\n\n ### [primaryTextHighlightColor](#/c:objc(cs)GMSAutocompleteResultsViewController(py)primaryTextHighlightColor)\n\n `\n ` \n The color used to highlight matching text in autocomplete results \n\n #### Declaration\n\n Swift \n\n var primaryTextHighlightColor: UIColor { get set }\n\n Objective-C \n\n @property (nonatomic, strong) UIColor *_Nonnull primaryTextHighlightColor;\n\n- `\n ``\n ``\n `\n\n ### [secondaryTextColor](#/c:objc(cs)GMSAutocompleteResultsViewController(py)secondaryTextColor)\n\n `\n ` \n The color of the second row of text in autocomplete results. \n\n #### Declaration\n\n Swift \n\n var secondaryTextColor: UIColor { get set }\n\n Objective-C \n\n @property (nonatomic, strong) UIColor *_Nonnull secondaryTextColor;\n\n- `\n ``\n ``\n `\n\n ### [tintColor](#/c:objc(cs)GMSAutocompleteResultsViewController(py)tintColor)\n\n `\n ` \n The tint color applied to controls in the Autocomplete view. \n\n #### Declaration\n\n Swift \n\n var tintColor: UIColor? { get set }\n\n Objective-C \n\n @property (nonatomic, strong, nullable) UIColor *tintColor;\n\n- `\n ``\n ``\n `\n\n ### [placeProperties](#/c:objc(cs)GMSAutocompleteResultsViewController(py)placeProperties)\n\n `\n ` \n Specify array of place property names to fetch for object [GMSPlace](../Classes/GMSPlace.html). Defaults to returning all\n details if not overridden. \n\n #### Declaration\n\n Swift \n\n var placeProperties: [String] { get set }\n\n Objective-C \n\n @property (nonatomic, strong) NSArray\u003cNSString *\u003e *_Nonnull placeProperties;\n\n- `\n ``\n ``\n `\n\n ### [placeFields](#/c:objc(cs)GMSAutocompleteResultsViewController(py)placeFields)\n\n `\n ` \n Specify individual place details to fetch for object [GMSPlace](../Classes/GMSPlace.html). Defaults to returning all\n details if not overridden. \n\n #### Declaration\n\n Swift \n\n var placeFields: ../Enums/GMSPlaceField.html { get set }\n\n Objective-C \n\n @property (nonatomic) ../Enums/GMSPlaceField.html placeFields;"]]