GooglePlacesSwift Framework Reference
Stay organized with collections
Save and categorize content based on your preferences.
AutocompleteFilter
struct AutocompleteFilter
extension AutocompleteFilter : Sendable
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.
-
The coordinate region bias to prefer place results near the location.
Defaults to nil.
-
The location bounds restriction to limit the place results to.
Defaults to nil.
-
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. Defaults to nil.
Declaration
Swift
var countries: Set<String>? { get }
-
Declaration
Swift
@available(*, deprecated)
init(types: Set<PlaceType>? = nil, countries: Set<String>? = nil, origin: CLLocation? = nil, coordinateRegionBias: (any CoordinateRegionBias)? = nil, coordinateRegionRestriction: (any CoordinateRegionRestriction)? = nil, regionCode: String? = nil, inputOffset: Int)
-
Declaration
Swift
init(types: Set<PlaceType>? = nil, countries: Set<String>? = nil, origin: CLLocation? = nil, coordinateRegionBias: (any CoordinateRegionBias)? = nil, coordinateRegionRestriction: (any CoordinateRegionRestriction)? = nil, regionCode: String? = nil, shouldIncludePureServiceAreaBusinesses: Bool = false)
-
The character offset for the input string. Indicates the completion starting position.
This value will be ignored if:
- The
AutocompleteRequest
inputOffset
is set.
- Used in
placeAutocomplete
or basicPlaceAutocomplete
.
Declaration
Swift
@available(*, deprecated, message: "Use AutocompleteRequest inputOffset instead.")
var inputOffset: Int { get }
-
The origin location for measuring the straight line distance between the origin location and
autocomplete predictions.
Defaults to nil.
Declaration
Swift
var origin: CLLocation? { get }
-
Affects address formatting, result ranking, and potentially hiding or showing certain results.
Declaration
Swift
var regionCode: String? { get }
-
Whether to include pure service area businesses 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.
Default value is false
.
Declaration
Swift
var shouldIncludePureServiceAreaBusinesses: Bool { get }
-
The filter applied to an autocomplete request to restrict results using up to 5 different
place types.
The default value is nil, which means no filters specified.
Note
This API can take an array of up to 5 entries from
Table A.
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\u003eAutocompleteFilter\u003c/code\u003e customizes autocomplete suggestions by applying restrictions like location bias, type, and country.\u003c/p\u003e\n"],["\u003cp\u003eIt allows biasing results to a specific region or restricting them within a boundary.\u003c/p\u003e\n"],["\u003cp\u003eDevelopers can filter results based on place types, countries, and the origin point for distance calculations.\u003c/p\u003e\n"],["\u003cp\u003eProperties like \u003ccode\u003einputOffset\u003c/code\u003e and \u003ccode\u003eregionCode\u003c/code\u003e provide further control over result formatting and ranking.\u003c/p\u003e\n"],["\u003cp\u003e\u003ccode\u003eAutocompleteFilter\u003c/code\u003e is initialized with optional parameters for flexible customization.\u003c/p\u003e\n"]]],[],null,["# GooglePlacesSwift Framework Reference\n\nAutocompleteFilter\n==================\n\n struct AutocompleteFilter\n\n extension AutocompleteFilter : Sendable\n\nRepresents a set of restrictions that may be applied to autocomplete requests. This allows\ncustomization of autocomplete suggestions to only those places that are of interest.\n- `\n ``\n ``\n `\n\n ### [coordinateRegionBias](#/s:17GooglePlacesSwift18AutocompleteFilterV20coordinateRegionBiasAA010CoordinategH0_pSgvp)\n\n `\n ` \n The coordinate region bias to prefer place results near the location.\n\n Defaults to nil. \n\n #### Declaration\n\n Swift \n\n var coordinateRegionBias: (any ../Protocols/CoordinateRegionBias.html)? { get }\n\n- `\n ``\n ``\n `\n\n ### [coordinateRegionRestriction](#/s:17GooglePlacesSwift18AutocompleteFilterV27coordinateRegionRestrictionAA010CoordinategH0_pSgvp)\n\n `\n ` \n The location bounds restriction to limit the place results to.\n\n Defaults to nil. \n\n #### Declaration\n\n Swift \n\n var coordinateRegionRestriction: (any ../Protocols/CoordinateRegionRestriction.html)? { get }\n\n- `\n ``\n ``\n `\n\n ### [countries](#/s:17GooglePlacesSwift18AutocompleteFilterV9countriesShySSGSgvp)\n\n `\n ` \n The countries to restrict results to.\n\n This should be a ISO 3166-1 Alpha-2 country code (case insensitive). Supports up to 5\n countries to filter. If nil, no country filtering will take place. Defaults to nil. \n\n #### Declaration\n\n Swift \n\n var countries: Set\u003cString\u003e? { get }\n\n- `\n ``\n ``\n `\n\n ### [init(types:countries:origin:coordinateRegionBias:coordinateRegionRestriction:regionCode:inputOffset:)](#/s:17GooglePlacesSwift18AutocompleteFilterV5types9countries6origin20coordinateRegionBias0iJ11Restriction10regionCode11inputOffsetACShyAA9PlaceTypeVGSg_ShySSGSgSo10CLLocationCSgAA010CoordinatejK0_pSgAA0tjL0_pSgSSSgSitcfc)\n\n `\n ` \n\n #### Declaration\n\n Swift \n\n @available(*, deprecated)\n init(types: Set\u003c../Structs/PlaceType.html\u003e? = nil, countries: Set\u003cString\u003e? = nil, origin: CLLocation? = nil, coordinateRegionBias: (any ../Protocols/CoordinateRegionBias.html)? = nil, coordinateRegionRestriction: (any ../Protocols/CoordinateRegionRestriction.html)? = nil, regionCode: String? = nil, inputOffset: Int)\n\n- `\n ``\n ``\n `\n\n ### [init(types:countries:origin:coordinateRegionBias:coordinateRegionRestriction:regionCode:shouldIncludePureServiceAreaBusinesses:)](#/s:17GooglePlacesSwift18AutocompleteFilterV5types9countries6origin20coordinateRegionBias0iJ11Restriction10regionCode38shouldIncludePureServiceAreaBusinessesACShyAA9PlaceTypeVGSg_ShySSGSgSo10CLLocationCSgAA010CoordinatejK0_pSgAA0xjL0_pSgSSSgSbtcfc)\n\n `\n ` \n\n #### Declaration\n\n Swift \n\n init(types: Set\u003c../Structs/PlaceType.html\u003e? = nil, countries: Set\u003cString\u003e? = nil, origin: CLLocation? = nil, coordinateRegionBias: (any ../Protocols/CoordinateRegionBias.html)? = nil, coordinateRegionRestriction: (any ../Protocols/CoordinateRegionRestriction.html)? = nil, regionCode: String? = nil, shouldIncludePureServiceAreaBusinesses: Bool = false)\n\n- `\n ``\n ``\n `\n\n ### [inputOffset](#/s:17GooglePlacesSwift18AutocompleteFilterV11inputOffsetSivp)\n\n `\n ` \n The character offset for the input string. Indicates the completion starting position.\n\n This value will be ignored if:\n - The [AutocompleteRequest](../Structs/AutocompleteRequest.html) `inputOffset` is set.\n - Used in `placeAutocomplete` or `basicPlaceAutocomplete`. \n\n #### Declaration\n\n Swift \n\n @available(*, deprecated, message: \"Use AutocompleteRequest inputOffset instead.\")\n var inputOffset: Int { get }\n\n- `\n ``\n ``\n `\n\n ### [origin](#/s:17GooglePlacesSwift18AutocompleteFilterV6originSo10CLLocationCSgvp)\n\n `\n ` \n The origin location for measuring the straight line distance between the origin location and\n autocomplete predictions.\n\n Defaults to nil. \n\n #### Declaration\n\n Swift \n\n var origin: CLLocation? { get }\n\n- `\n ``\n ``\n `\n\n ### [regionCode](#/s:17GooglePlacesSwift18AutocompleteFilterV10regionCodeSSSgvp)\n\n `\n ` \n Affects address formatting, result ranking, and potentially hiding or showing certain results. \n\n #### Declaration\n\n Swift \n\n var regionCode: String? { get }\n\n- `\n ``\n ``\n `\n\n ### [shouldIncludePureServiceAreaBusinesses](#/s:17GooglePlacesSwift18AutocompleteFilterV38shouldIncludePureServiceAreaBusinessesSbvp)\n\n `\n ` \n Whether to include pure service area businesses in the results.\n\n A pure service area business is a business that visits or delivers to customers directly\n but does not serve customers at their business address. For example, businesses like\n cleaning services or plumbers. Those businesses do not have a physical address or location\n on Google Maps.\n\n Default value is `false`. \n\n #### Declaration\n\n Swift \n\n var shouldIncludePureServiceAreaBusinesses: Bool { get }\n\n- `\n ``\n ``\n `\n\n ### [types](#/s:17GooglePlacesSwift18AutocompleteFilterV5typesShyAA9PlaceTypeVGSgvp)\n\n `\n ` \n The filter applied to an autocomplete request to restrict results using up to 5 different\n place types.\n\n The default value is nil, which means no filters specified. \n Note\n This API can take an array of up to 5 entries from [Table A](https://developers.google.com/maps/documentation/places/ios-sdk/place-types). \n\n #### Declaration\n\n Swift \n\n var types: Set\u003c../Structs/PlaceType.html\u003e? { get }"]]