GooglePlacesSwift Framework Reference

SearchByTextRequest

struct SearchByTextRequest
  • How results will be ranked in the response.

    Declaration

    Swift

    enum RankPreference
    extension SearchByTextRequest.RankPreference : CaseIterable, Equatable, Hashable, Identifiable
  • The requested place type.

    See https://developers.google.com/maps/documentation/places/web-service/search-textual#supported-types for the most up-to-date list of supported types available

    Declaration

    Swift

    var includedType: PlaceType? { get }
  • Instantiates a SearchByTextRequest with a text query and place properties to return.

    Declaration

    Swift

    init(textQuery: String, placeProperties: [PlaceProperty], locationBias: (any CoordinateRegionBias), includedType: PlaceType? = nil, maxResultCount: Int = 20, minRating: Float = 0.0, isOpenNow: Bool = true, priceLevels: Set<PriceLevel>? = nil, rankPreference: SearchByTextRequest.RankPreference = .distance, regionCode: String? = nil, isStrictTypeFiltering: Bool = false)

    Parameters

    textQuery

    The string query for the search request.

    placeProperties

    The PlacePropertys that should be included in place results. Must not be empty. An empty list will result in an error when trying to send the request.

    locationBias

    The biased region to search.

    includedType

    The requested place type.

    maxResultCount

    The maximum number of results to return. Must be between 1 and 20 (default), inclusive.

    minRating

    The minimum average user rating for places to be included in the results, between 0.0 (default) and 5.0, inclusive.

    isOpenNow

    Filter results to places that are currently open. Defaults to true.

    priceLevels

    A set of PriceLevel values to filter places included in the results.

    rankPreference

    The RankPreference to sort the results. Defaults to .distance.

    regionCode

    The unicode country/region code (CLDR) of the request location.

    isStrictTypeFiltering

    Defines if only results of includedType should be returned. Defaults to false.

  • Instantiates a SearchByTextRequest with a text query and place properties to return.

    Declaration

    Swift

    init(textQuery: String, placeProperties: [PlaceProperty], locationRestriction: (any CoordinateRegionRestriction), includedType: PlaceType? = nil, maxResultCount: Int = 20, minRating: Float = 0.0, isOpenNow: Bool = true, priceLevels: Set<PriceLevel>? = nil, rankPreference: SearchByTextRequest.RankPreference = .distance, regionCode: String? = nil, isStrictTypeFiltering: Bool = false)

    Parameters

    textQuery

    The string query for the search request.

    placeProperties

    The PlacePropertys that should be included in place results. Must not be empty. An empty list will result in an error when trying to send the request.

    locationRestriction

    The restricted region to search.

    includedType

    The requested place type.

    maxResultCount

    The maximum number of results to return. Must be between 1 and 20 (default), inclusive.

    minRating

    The minimum average user rating for places to be included in the results, between 0.0 (default) and 5.0, inclusive.

    isOpenNow

    Filter results to places that are currently open. Defaults to true.

    priceLevels

    A set of PriceLevel values to filter places included in the results.

    rankPreference

    The RankPreference to sort the results. Defaults to .distance.

    regionCode

    The unicode country/region code (CLDR) of the request location.

    isStrictTypeFiltering

    Defines if only results of includedType should be returned. Defaults to false.

  • Filter results to places that are currently open. */

    Declaration

    Swift

    var isOpenNow: Bool { get }
  • Defines whether only results of includedType should be returned.

    Default value is false`.

    Declaration

    Swift

    var isStrictTypeFiltering: Bool { get }
  • The biased region to search.

    This location serves as a bias, which means there is a preference for results in the given location.

    If set along with locationRestriction`, this will be ignored.

    Declaration

    Swift

    var locationBias: (any CoordinateRegionBias)? { get }
  • The restricted region to search.

    This location serves as a restriction which means results outside the given location will not be returned.

    Cannot be used with locationBias`.

    Declaration

    Swift

    var locationRestriction: (any CoordinateRegionRestriction)? { get }
  • Returns the maximum number of results to return between PlaceResultCountMinResultCount and PlaceResultCountMaxResultCount.

    The allowed range of this field can be found at https://developers.google.com/maps/documentation/places/web-service/search-textual#maxresultcount. Defaults to the upper limit.

    Declaration

    Swift

    var maxResultCount: Int { get }
  • The minimum average user rating for places to be included in the results. Rating will be within a range between 0.0 and 5.0.

    The specified rating will be rounded up to the nearest 0.5. See Place rating property.

    Declaration

    Swift

    var minRating: Float { get }
  • The array of PlaceProperty that should be included in place results.

    Declaration

    Swift

    var placeProperties: [PlaceProperty] { get }
  • An array of the PriceLevel values that should filter the places included in the results.

    Any combination of price levels can be selected; default is all price levels.

    Declaration

    Swift

    var priceLevels: Set<PriceLevel>? { get }
  • The RankPreference used to sort the results returned from the request.

    Declaration

    Swift

    var rankPreference: SearchByTextRequest.RankPreference { get }
  • The unicode country/region code (CLDR) of the location where the request is coming from.

    It is used to display the place details, like region-specific place name, if available.

    See https://unicode.org/cldr/charts/latest/supplemental/territory_containment_un_m_49.html for region codes.

    Declaration

    Swift

    var regionCode: String? { get }
  • The text query for the search.

    Declaration

    Swift

    var textQuery: String { get }