GooglePlaces Framework Reference

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.

    Declaration

    Swift

    @IBOutlet weak var delegate: (any GMSAutocompleteViewControllerDelegate)? { get set }

    Objective-C

    @property (nonatomic, weak, nullable) id<GMSAutocompleteViewControllerDelegate> delegate;
  • Filter to apply to autocomplete suggestions (can be nil).

    Declaration

    Swift

    var autocompleteFilter: GMSAutocompleteFilter? { get set }

    Objective-C

    @property (nonatomic, strong, nullable) GMSAutocompleteFilter *autocompleteFilter;
  • 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.

    Declaration

    Swift

    var placeFields: GMSPlaceField { get set }

    Objective-C

    @property (nonatomic) GMSPlaceField placeFields;
  • 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;