GooglePlaces Framework Reference

GMSAutocompleteFilter

@interface GMSAutocompleteFilter : NSObject

This class represents a set of restrictions that may be applied to autocomplete requests. This allows customization of autocomplete suggestions to only those places that are of interest.

  • Deprecated

    type property is deprecated in favor of types.

    DEPRECATED. The type filter applied to an autocomplete request to restrict results to different types. Default value is kGMSPlacesAutocompleteTypeFilterNoFilter.

    NOTE: Ignored if the “types” property is set.

    Declaration

    Swift

    var type: GMSPlacesAutocompleteTypeFilter { get set }

    Objective-C

    @property (nonatomic) GMSPlacesAutocompleteTypeFilter type;
  • The filter applied to an autocomplete request to restrict results using up to 5 different place types.

    NOTE: This API can take an array of up to 5 entries. If you are using GMSAutocompleteRequest, this API can take types from table_A. Otherwise, take data from table_1 or table_2, but only a single entry in table_3. Default value is null, which means no filters specified. Overrides the deprecated “type” property if this is set.

    Declaration

    Swift

    var types: [String]? { get set }

    Objective-C

    @property (nonatomic, nullable) NSArray<NSString *> *types;
  • Deprecated

    country property is deprecated in favor of countries.

    DEPRECATED. The country to restrict results to. This should be a ISO 3166-1 Alpha-2 country code (case insensitive). If nil, no country filtering will take place.

    NOTE: Ignored if the “countries” property is set.

    Declaration

    Swift

    var country: String? { get set }

    Objective-C

    @property (nonatomic, copy, nullable) NSString *country;
  • The countries to restrict results to. This should be a ISO 3166-1 Alpha-2 country code (case insensitive). Supports up to 5 countries to filter. If nil, no country filtering will take place.

    NOTE: Overrides the deprecated “country” property if that is set.

    Declaration

    Swift

    var countries: [String]? { get set }

    Objective-C

    @property (nonatomic, copy, nullable) NSArray<NSString *> *countries;
  • The straight line distance origin location for measuring the straight line distance between the origin location and autocomplete predictions.

    Declaration

    Swift

    var origin: CLLocation? { get set }

    Objective-C

    @property (nonatomic, nullable) CLLocation *origin;
  • The optional location bias to prefer place results near the location.

    Declaration

    Swift

    var locationBias: (any GMSPlaceLocationBias)? { get set }

    Objective-C

    @property (nonatomic, nullable) id<GMSPlaceLocationBias> locationBias;
  • The optional location restriction to limit place results.

    Declaration

    Swift

    var locationRestriction: (any GMSPlaceLocationRestriction)? { get set }

    Objective-C

    @property (nonatomic, nullable) id<GMSPlaceLocationRestriction> locationRestriction;
  • regionCode affects address formatting, result ranking, and potentially hiding or showing certain results.

    Declaration

    Swift

    var regionCode: String? { get set }

    Objective-C

    @property (nonatomic, nullable) NSString *regionCode;
  • inputOffset is the character offset of the input that indicates where the

    • completions may start from.

    Declaration

    Swift

    var inputOffset: Int32 { get set }

    Objective-C

    @property (nonatomic) int32_t inputOffset;
  • Whether pure service area businesses should be included in the results.

    A pure service area business is a business that visits or delivers to customers directly but does not serve customers at their business address. For example, businesses like cleaning services or plumbers. Those businesses do not have a physical address or location on Google Maps. Places will not return fields including location, plusCode, and other location related fields for these businesses.

    Default value is false.

    Declaration

    Swift

    var shouldIncludePureServiceAreaBusinesses: Bool { get set }

    Objective-C

    @property (nonatomic) BOOL shouldIncludePureServiceAreaBusinesses;