GooglePlaces Framework Reference

GMSPlaceSearchByTextRequest

@interface GMSPlaceSearchByTextRequest : NSObject

Represents a text search request definition to be sent via GMSPlacesClient.

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

    Declaration

    Swift

    init(textQuery: String, placeProperties: [String])

    Objective-C

    - (nonnull instancetype)initWithTextQuery:(nonnull NSString *)textQuery
                              placeProperties:
                                  (nonnull NSArray<NSString *> *)placeProperties;

    Parameters

    textQuery

    The string query for the search request.

    placeProperties

    The array of GMSPlaceProperty 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.

  • Unavailable

    Default init is not available. Please use the designated initializer.

    Declaration

    Objective-C

    - (nonnull instancetype)init;
  • 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: String? { get set }

    Objective-C

    @property (nonatomic, copy, nullable) NSString *includedType;
  • The maximum number of results to return. Allows values between 1 and 20.

    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: Int32 { get set }

    Objective-C

    @property (nonatomic) int maxResultCount;
  • 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 GMSPlace rating property.

    Defaults to 0.0.

    Declaration

    Swift

    var minRating: Float { get set }

    Objective-C

    @property (nonatomic) float minRating;
  • Filter results to places that are currently open.

    Defaults to true.

    Declaration

    Swift

    var isOpenNow: Bool { get set }

    Objective-C

    @property (nonatomic) BOOL isOpenNow;
  • The array of GMSPlaceProperty that should be included in place results.

    Declaration

    Swift

    var placeProperties: [String] { get }

    Objective-C

    @property (nonatomic, readonly) NSArray<NSString *> *_Nonnull placeProperties;
  • An Array of the GMSPlacesPriceLevel 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: [NSNumber]? { get set }

    Objective-C

    @property (nonatomic, nullable) NSArray<NSNumber *> *priceLevels;
  • The GMSPlaceSearchByTextRankPreference used to sort the results returned from the request.

    Declaration

    Swift

    var rankPreference: GMSPlaceSearchByTextRankPreference { get set }

    Objective-C

    @property (nonatomic) GMSPlaceSearchByTextRankPreference rankPreference;
  • The unicode country/region code (CLDR) of the location where the request is coming from.

    The region may affect the format and type of data returned. If no code is provided, there is no bias towards any country/region.

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

    Declaration

    Swift

    var regionCode: String? { get set }

    Objective-C

    @property (nonatomic, copy, nullable) NSString *regionCode;
  • Defines whether only results of includedType should be returned.

    Default value is false.

    Declaration

    Swift

    var isStrictTypeFiltering: Bool { get set }

    Objective-C

    @property (nonatomic) BOOL isStrictTypeFiltering;
  • The text query for the search.

    Declaration

    Swift

    var textQuery: String { get }

    Objective-C

    @property (nonatomic, copy, readonly) NSString *_Nonnull textQuery;
  • The biased region to search.

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

    A locationRestriction or a locationBias must be set when performing a search request.

    If set along with locationRestriction, this will be ignored.

    Declaration

    Swift

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

    Objective-C

    @property (nonatomic, nullable) id<GMSPlaceLocationBias> locationBias;
  • The restricted region to search.

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

    A locationRestriction or a locationBias must be set when performing a search request.

    Cannot be used with locationBias.

    The locationRestriction for text search only supports GMSPlaceRectangularLocationOption.

    Declaration

    Swift

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

    Objective-C

    @property (nonatomic, nullable) id<GMSPlaceLocationRestriction> locationRestriction;