GooglePlacesSwift Framework Reference

AutocompleteFilter

struct AutocompleteFilter

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.

    Declaration

    Swift

    var coordinateRegionBias: (any CoordinateRegionBias)? { get }
  • The location bounds restriction to limit the place results to.

    Defaults to nil.

    Declaration

    Swift

    var coordinateRegionRestriction: (any CoordinateRegionRestriction)? { get }
  • 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 }
  • Undocumented

    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, inputOffset: Int = 0)
  • The character offset for the input string. Indicates the completion starting position.

    Declaration

    Swift

    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 }
  • 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.

    Declaration

    Swift

    var types: Set<PlaceType>? { get }