GooglePlaces Framework Reference
Stay organized with collections
Save and categorize content based on your preferences.
GMSAutocompleteViewController
@interface GMSAutocompleteViewController : UIViewController
GMSAutocompleteViewController
provides an interface that displays a table of autocomplete
predictions that updates as the user enters text. Place selections made by the user are
returned to the app via the GMSAutocompleteViewControllerResultsDelegate
protocol.
To use GMSAutocompleteViewController
, set its delegate to an object in your app that
conforms to the GMSAutocompleteViewControllerDelegate
protocol and present the controller
(eg using presentViewController). The GMSAutocompleteViewControllerDelegate
delegate methods
can be used to determine when the user has selected a place or has cancelled selection.
-
Delegate to be notified when a place is selected or picking is cancelled.
-
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 individual place details to fetch for object GMSPlace
. Defaults to returning all
details if not overridden.
-
The GMSPlaceProperty
for specifying explicit place details to be requested. Default returns
all available properties.
Declaration
Swift
var placeProperties: [String] { get set }
Objective-C
@property (nonatomic, strong) NSArray<NSString *> *_Nonnull placeProperties;
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\u003eGMSAutocompleteViewController\u003c/code\u003e presents an interface for users to select a place from a list of autocomplete predictions.\u003c/p\u003e\n"],["\u003cp\u003ePlace selections are communicated back to the app through the \u003ccode\u003eGMSAutocompleteViewControllerResultsDelegate\u003c/code\u003e protocol.\u003c/p\u003e\n"],["\u003cp\u003eDevelopers can customize the appearance of the autocomplete view, such as colors and table cell styles.\u003c/p\u003e\n"],["\u003cp\u003eFiltering of autocomplete suggestions is possible using the \u003ccode\u003eautocompleteFilter\u003c/code\u003e property.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003eplaceFields\u003c/code\u003e and \u003ccode\u003eplaceProperties\u003c/code\u003e properties allow for the customization of the level of place details returned upon selection.\u003c/p\u003e\n"]]],["`GMSAutocompleteViewController` displays autocomplete predictions as users type. To use it, set a delegate conforming to `GMSAutocompleteViewControllerDelegate` to handle place selections or cancellations. Customize the suggestions using `autocompleteFilter`. The view's appearance can be modified via properties like `tableCellBackgroundColor`, `primaryTextColor`, and `tintColor`. Specify the details fetched for the selected place through `placeFields` or `placeProperties`.\n"],null,["# GooglePlaces Framework Reference\n\nGMSAutocompleteViewController\n=============================\n\n @interface GMSAutocompleteViewController : UIViewController\n\n`GMSAutocompleteViewController` provides an interface that displays a table of autocomplete\npredictions that updates as the user enters text. Place selections made by the user are\nreturned to the app via the `GMSAutocompleteViewControllerResultsDelegate` protocol.\n\nTo use `GMSAutocompleteViewController`, set its delegate to an object in your app that\nconforms to the [GMSAutocompleteViewControllerDelegate](../Protocols/GMSAutocompleteViewControllerDelegate.html) protocol and present the controller\n(eg using presentViewController). The [GMSAutocompleteViewControllerDelegate](../Protocols/GMSAutocompleteViewControllerDelegate.html) delegate methods\ncan be used to determine when the user has selected a place or has cancelled selection.\n- `\n ``\n ``\n `\n\n ### [delegate](#/c:objc(cs)GMSAutocompleteViewController(py)delegate)\n\n `\n ` \n Delegate to be notified when a place is selected or picking is cancelled. \n\n #### Declaration\n\n Swift \n\n @IBOutlet weak var delegate: (any ../Protocols/GMSAutocompleteViewControllerDelegate.html)? { get set }\n\n Objective-C \n\n @property (nonatomic, weak, nullable) id\u003c../Protocols/GMSAutocompleteViewControllerDelegate.html\u003e delegate;\n\n- `\n ``\n ``\n `\n\n ### [autocompleteFilter](#/c:objc(cs)GMSAutocompleteViewController(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)GMSAutocompleteViewController(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)GMSAutocompleteViewController(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)GMSAutocompleteViewController(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)GMSAutocompleteViewController(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)GMSAutocompleteViewController(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)GMSAutocompleteViewController(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 ### [placeFields](#/c:objc(cs)GMSAutocompleteViewController(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;\n\n- `\n ``\n ``\n `\n\n ### [placeProperties](#/c:objc(cs)GMSAutocompleteViewController(py)placeProperties)\n\n `\n ` \n The [GMSPlaceProperty](../Type-Definitions/GMSPlaceProperty.html) for specifying explicit place details to be requested. Default returns\n all available properties. \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;"]]