GooglePlaces Framework Reference

GMSPlace

  @interface 
 GMSPlace 
 : 
 NSObject 
 

Represents a particular physical place. A GMSPlace encapsulates information about a physical location, including its name, location, and any other information we might have about it. This class is immutable.

  • Name of the place.

    Declaration

    Swift

      var 
     name 
     : 
     String 
     ? 
     { 
     get 
     } 
     
    

    Objective-C

      @property 
     ( 
     nonatomic 
     , 
     copy 
     , 
     readonly 
     , 
     nullable 
     ) 
     NSString 
     * 
     name 
     ; 
     
    
  • Place ID of this place.

    Declaration

    Swift

      var 
     placeID 
     : 
     String 
     ? 
     { 
     get 
     } 
     
    

    Objective-C

      @property 
     ( 
     nonatomic 
     , 
     copy 
     , 
     readonly 
     , 
     nullable 
     ) 
     NSString 
     * 
     placeID 
     ; 
     
    
  • Location of the place. The location is not necessarily the center of the Place, or any particular entry or exit point, but some arbitrarily chosen point within the geographic extent of the Place.

    Declaration

    Swift

      var 
     coordinate 
     : 
     CLLocationCoordinate2D 
     { 
     get 
     } 
     
    

    Objective-C

      @property 
     ( 
     nonatomic 
     , 
     readonly 
     ) 
     CLLocationCoordinate2D 
     coordinate 
     ; 
     
    
  • Phone number of this place, in international format, i.e. including the country code prefixed with “+”. For example, Google Sydney’s phone number is “+61 2 9374 4000”.

    Declaration

    Swift

      var 
     phoneNumber 
     : 
     String 
     ? 
     { 
     get 
     } 
     
    

    Objective-C

      @property 
     ( 
     nonatomic 
     , 
     copy 
     , 
     readonly 
     , 
     nullable 
     ) 
     NSString 
     * 
     phoneNumber 
     ; 
     
    
  • Address of the place as a simple string.

    Declaration

    Swift

      var 
     formattedAddress 
     : 
     String 
     ? 
     { 
     get 
     } 
     
    

    Objective-C

      @property 
     ( 
     nonatomic 
     , 
     copy 
     , 
     readonly 
     , 
     nullable 
     ) 
     NSString 
     * 
     formattedAddress 
     ; 
     
    
  • Five-star rating for this place based on user reviews.

    Ratings range from 1.0 to 5.0. 0.0 means we have no rating for this place (e.g. because not enough users have reviewed this place).

    Declaration

    Swift

      var 
     rating 
     : 
     Float 
     { 
     get 
     } 
     
    

    Objective-C

      @property 
     ( 
     nonatomic 
     , 
     readonly 
     ) 
     float 
     rating 
     ; 
     
    
  • An array of GMSPlaceReview objects representing the user reviews of the place.

    Declaration

    Swift

      var 
     reviews 
     : 
     [ 
      GMSPlaceReview 
     
     ]? 
     { 
     get 
     } 
     
    

    Objective-C

      @property 
     ( 
     nonatomic 
     , 
     copy 
     , 
     readonly 
     , 
     nullable 
     ) 
     NSArray 
     < 
      GMSPlaceReview 
     
     *> 
     * 
     reviews 
     ; 
     
    
  • Price level for this place, as integers from 0 to 4.

    e.g. A value of 4 means this place is “$$$$” (expensive). A value of 0 means free (such as a museum with free admission).

    Declaration

    Swift

      var 
     priceLevel 
     : 
      GMSPlacesPriceLevel 
     
     { 
     get 
     } 
     
    

    Objective-C

      @property 
     ( 
     nonatomic 
     , 
     readonly 
     ) 
      GMSPlacesPriceLevel 
     
     priceLevel 
     ; 
     
    
  • Declaration

    Swift

      var 
     types 
     : 
     [ 
     String 
     ]? 
     { 
     get 
     } 
     
    

    Objective-C

      @property 
     ( 
     nonatomic 
     , 
     copy 
     , 
     readonly 
     , 
     nullable 
     ) 
     NSArray 
     < 
     NSString 
     *> 
     * 
     types 
     ; 
     
    
  • Website for this place.

    Declaration

    Swift

      var 
     website 
     : 
     URL 
     ? 
     { 
     get 
     } 
     
    

    Objective-C

      @property 
     ( 
     nonatomic 
     , 
     copy 
     , 
     readonly 
     , 
     nullable 
     ) 
     NSURL 
     * 
     website 
     ; 
     
    
  • The data provider attribution string for this place.

    These are provided as a NSAttributedString, which may contain hyperlinks to the website of each provider.

    In general, these must be shown to the user if data from this GMSPlace is shown, as described in the Places SDK Terms of Service.

    Declaration

    Swift

      @NSCopying 
     var 
     attributions 
     : 
     NSAttributedString 
     ? 
     { 
     get 
     } 
     
    

    Objective-C

      @property 
     ( 
     nonatomic 
     , 
     copy 
     , 
     readonly 
     , 
     nullable 
     ) 
     NSAttributedString 
     * 
     attributions 
     ; 
     
    
  • The recommended viewport for this place. May be nil if the size of the place is not known.

    This returns a viewport of a size that is suitable for displaying this place. For example, a GMSPlace object representing a store may have a relatively small viewport, while a GMSPlace object representing a country may have a very large viewport.

    Declaration

    Swift

      var 
     viewportInfo 
     : 
      GMSPlaceViewportInfo 
     
     ? 
     { 
     get 
     } 
     
    

    Objective-C

      @property 
     ( 
     nonatomic 
     , 
     strong 
     , 
     readonly 
     , 
     nullable 
     ) 
      GMSPlaceViewportInfo 
     
     * 
     viewportInfo 
     ; 
     
    
  • An array of GMSAddressComponent objects representing the components in the place’s address. These components are provided for the purpose of extracting structured information about the place’s address: for example, finding the city that a place is in.

    These components should not be used for address formatting. If a formatted address is required, use the formattedAddress property, which provides a localized formatted address.

    Declaration

    Swift

      var 
     addressComponents 
     : 
     [ 
      GMSAddressComponent 
     
     ]? 
     { 
     get 
     } 
     
    

    Objective-C

      @property 
     ( 
     nonatomic 
     , 
     copy 
     , 
     readonly 
     , 
     nullable 
     ) 
     NSArray 
     < 
      GMSAddressComponent 
     
     *> 
     * 
     addressComponents 
     ; 
     
    
  • The Plus code representation of location for this place.

    Declaration

    Swift

      var 
     plusCode 
     : 
      GMSPlusCode 
     
     ? 
     { 
     get 
     } 
     
    

    Objective-C

      @property 
     ( 
     nonatomic 
     , 
     strong 
     , 
     readonly 
     , 
     nullable 
     ) 
      GMSPlusCode 
     
     * 
     plusCode 
     ; 
     
    
  • The normal business Opening Hours information for this place. Includes open status, periods and weekday text when available.

    Declaration

    Swift

      var 
     openingHours 
     : 
      GMSOpeningHours 
     
     ? 
     { 
     get 
     } 
     
    

    Objective-C

      @property 
     ( 
     nonatomic 
     , 
     strong 
     , 
     readonly 
     , 
     nullable 
     ) 
      GMSOpeningHours 
     
     * 
     openingHours 
     ; 
     
    
  • Returns this place’s hours of operation over the next seven days.

    The time period starts at midnight on the date of the request and ends at 11:59 pm six days later.

    GMSPlaceSpecialDay entries on GMSOpeningHours will only be present for GMSPlace currentOpeningHours and GMSPlace secondaryOpeningHours .

    Declaration

    Swift

      var 
     currentOpeningHours 
     : 
      GMSOpeningHours 
     
     ? 
     { 
     get 
     } 
     
    

    Objective-C

      @property 
     ( 
     nonatomic 
     , 
     strong 
     , 
     readonly 
     , 
     nullable 
     ) 
      GMSOpeningHours 
     
     * 
     currentOpeningHours 
     ; 
     
    
  • Returns an array of this place’s secondary hour(s) of operation over the next seven days.

    Secondary hours are different from a business’s main hours. For example, a restaurant can specify drive through hours or delivery hours as its secondary hours. See GMSPlaceHoursType for the different types of secondary hours.

    GMSPlaceSpecialDay entries on GMSOpeningHours will only be present for GMSPlace currentOpeningHours and GMSPlace secondaryOpeningHours .

    Declaration

    Swift

      var 
     secondaryOpeningHours 
     : 
     [ 
      GMSOpeningHours 
     
     ]? 
     { 
     get 
     } 
     
    

    Objective-C

      @property 
     ( 
     nonatomic 
     , 
     copy 
     , 
     readonly 
     , 
     nullable 
     ) 
     NSArray 
     < 
      GMSOpeningHours 
     
     *> 
     * 
     secondaryOpeningHours 
     ; 
     
    
  • Represents how many reviews make up this place’s rating.

    Declaration

    Swift

      var 
     userRatingsTotal 
     : 
     UInt 
     { 
     get 
     } 
     
    

    Objective-C

      @property 
     ( 
     nonatomic 
     , 
     readonly 
     ) 
     NSUInteger 
     userRatingsTotal 
     ; 
     
    
  • An array of GMSPlacePhotoMetadata objects representing the photos of the place.

    Declaration

    Swift

      var 
     photos 
     : 
     [ 
      GMSPlacePhotoMetadata 
     
     ]? 
     { 
     get 
     } 
     
    

    Objective-C

      @property 
     ( 
     nonatomic 
     , 
     copy 
     , 
     readonly 
     , 
     nullable 
     ) 
     NSArray 
     < 
      GMSPlacePhotoMetadata 
     
     *> 
     * 
     photos 
     ; 
     
    
  • The timezone UTC offset of the place in minutes.

    Declaration

    Swift

      var 
     utcOffsetMinutes 
     : 
     NSNumber 
     ? 
     { 
     get 
     } 
     
    

    Objective-C

      @property 
     ( 
     nonatomic 
     , 
     readonly 
     , 
     nullable 
     ) 
     NSNumber 
     * 
     UTCOffsetMinutes 
     ; 
     
    
  • The GMSPlaceBusinessStatus of the place.

    Declaration

    Swift

      var 
     businessStatus 
     : 
      GMSPlacesBusinessStatus 
     
     { 
     get 
     } 
     
    

    Objective-C

      @property 
     ( 
     nonatomic 
     , 
     readonly 
     ) 
      GMSPlacesBusinessStatus 
     
     businessStatus 
     ; 
     
    
  • Returns this place’s editorial summary.

    Declaration

    Swift

      var 
     editorialSummary 
     : 
     String 
     ? 
     { 
     get 
     } 
     
    

    Objective-C

      @property 
     ( 
     nonatomic 
     , 
     copy 
     , 
     readonly 
     , 
     nullable 
     ) 
     NSString 
     * 
     editorialSummary 
     ; 
     
    
  • Unavailable

    Default init is not available.

    Declaration

    Objective-C

      - 
     ( 
     nonnull 
     instancetype 
     ) 
     init 
     ; 
     
    
  • Deprecated

    (This method is deprecated in favor of GMSPlacesClient#isOpenAtDate:place:date:callback and will be removed in a future release.

    Calculates if a place is open based on openingHours , UTCOffsetMinutes , and date .

    Declaration

    Swift

      func 
     isOpen 
     ( 
     at 
     date 
     : 
     Date 
     ) 
     -> 
      GMSPlaceOpenStatus 
     
     
    

    Objective-C

      - 
     ( 
      GMSPlaceOpenStatus 
     
     ) 
     isOpenAtDate 
     :( 
     nonnull 
     NSDate 
     * 
     ) 
     date 
     ; 
     
    

    Parameters

    date

    A reference point in time used to determine if the place is open.

    Return Value

    GMSPlaceOpenStatusOpen if the place is open, GMSPlaceOpenStatusClosed if the place is closed, and GMSPlaceOpenStatusUnknown if the open status is unknown.

  • Deprecated

    (This method is deprecated in favor of GMSPlacesClient#isOpen:place:callback and will be removed in a future release.

    Calculates if a place is open based on openingHours , UTCOffsetMinutes , and current date and time obtained from [NSDate date] .

    Declaration

    Swift

      func 
     isOpen 
     () 
     -> 
      GMSPlaceOpenStatus 
     
     
    

    Objective-C

      - 
     ( 
      GMSPlaceOpenStatus 
     
     ) 
     isOpen 
     ; 
     
    

    Return Value

    GMSPlaceOpenStatusOpen if the place is open, GMSPlaceOpenStatusClosed if the place is closed, and GMSPlaceOpenStatusUnknown if the open status is unknown.

  • Background color of the icon according to Place type, to color the view behind the icon.

    Declaration

    Swift

      var 
     iconBackgroundColor 
     : 
     UIColor 
     ? 
     { 
     get 
     } 
     
    

    Objective-C

      @property 
     ( 
     nonatomic 
     , 
     readonly 
     , 
     nullable 
     ) 
     UIColor 
     * 
     iconBackgroundColor 
     ; 
     
    
  • The URL according to Place type, which you can use to retrieve the NSData of the Place icon. NOTES: URL link does not expire and the image size aspect ratio may be different depending on type.

    Declaration

    Swift

      var 
     iconImageURL 
     : 
     URL 
     ? 
     { 
     get 
     } 
     
    

    Objective-C

      @property 
     ( 
     nonatomic 
     , 
     readonly 
     , 
     nullable 
     ) 
     NSURL 
     * 
     iconImageURL 
     ; 
     
    
  • Place Attribute for takeout experience.

    Declaration

    Swift

      var 
     takeout 
     : 
      GMSBooleanPlaceAttribute 
     
     { 
     get 
     } 
     
    

    Objective-C

      @property 
     ( 
     nonatomic 
     , 
     readonly 
     ) 
      GMSBooleanPlaceAttribute 
     
     takeout 
     ; 
     
    
  • Place Attribute for delivery services.

    Declaration

    Swift

      var 
     delivery 
     : 
      GMSBooleanPlaceAttribute 
     
     { 
     get 
     } 
     
    

    Objective-C

      @property 
     ( 
     nonatomic 
     , 
     readonly 
     ) 
      GMSBooleanPlaceAttribute 
     
     delivery 
     ; 
     
    
  • Place Attribute for dine in experience.

    Declaration

    Swift

      var 
     dineIn 
     : 
      GMSBooleanPlaceAttribute 
     
     { 
     get 
     } 
     
    

    Objective-C

      @property 
     ( 
     nonatomic 
     , 
     readonly 
     ) 
      GMSBooleanPlaceAttribute 
     
     dineIn 
     ; 
     
    
  • Place Attribute for curbside pickup services.

    Declaration

    Swift

      var 
     curbsidePickup 
     : 
      GMSBooleanPlaceAttribute 
     
     { 
     get 
     } 
     
    

    Objective-C

      @property 
     ( 
     nonatomic 
     , 
     readonly 
     ) 
      GMSBooleanPlaceAttribute 
     
     curbsidePickup 
     ; 
     
    
  • Place Attribute indicating place is popular with tourists.

    Declaration

    Swift

      var 
     reservable 
     : 
      GMSBooleanPlaceAttribute 
     
     { 
     get 
     } 
     
    

    Objective-C

      @property 
     ( 
     nonatomic 
     , 
     readonly 
     ) 
      GMSBooleanPlaceAttribute 
     
     reservable 
     ; 
     
    
  • Place Attribute indicating place serves breakfast.

    Declaration

    Swift

      var 
     servesBreakfast 
     : 
      GMSBooleanPlaceAttribute 
     
     { 
     get 
     } 
     
    

    Objective-C

      @property 
     ( 
     nonatomic 
     , 
     readonly 
     ) 
      GMSBooleanPlaceAttribute 
     
     servesBreakfast 
     ; 
     
    
  • Place Attribute indicating place serves lunch.

    Declaration

    Swift

      var 
     servesLunch 
     : 
      GMSBooleanPlaceAttribute 
     
     { 
     get 
     } 
     
    

    Objective-C

      @property 
     ( 
     nonatomic 
     , 
     readonly 
     ) 
      GMSBooleanPlaceAttribute 
     
     servesLunch 
     ; 
     
    
  • Place Attribute indicating place serves dinner.

    Declaration

    Swift

      var 
     servesDinner 
     : 
      GMSBooleanPlaceAttribute 
     
     { 
     get 
     } 
     
    

    Objective-C

      @property 
     ( 
     nonatomic 
     , 
     readonly 
     ) 
      GMSBooleanPlaceAttribute 
     
     servesDinner 
     ; 
     
    
  • Place Attribute indicating place serves beer.

    Declaration

    Swift

      var 
     servesBeer 
     : 
      GMSBooleanPlaceAttribute 
     
     { 
     get 
     } 
     
    

    Objective-C

      @property 
     ( 
     nonatomic 
     , 
     readonly 
     ) 
      GMSBooleanPlaceAttribute 
     
     servesBeer 
     ; 
     
    
  • Place Attribute indicating place serves wine.

    Declaration

    Swift

      var 
     servesWine 
     : 
      GMSBooleanPlaceAttribute 
     
     { 
     get 
     } 
     
    

    Objective-C

      @property 
     ( 
     nonatomic 
     , 
     readonly 
     ) 
      GMSBooleanPlaceAttribute 
     
     servesWine 
     ; 
     
    
  • Place Attribute indicating place serves brunch.

    Declaration

    Swift

      var 
     servesBrunch 
     : 
      GMSBooleanPlaceAttribute 
     
     { 
     get 
     } 
     
    

    Objective-C

      @property 
     ( 
     nonatomic 
     , 
     readonly 
     ) 
      GMSBooleanPlaceAttribute 
     
     servesBrunch 
     ; 
     
    
  • Place Attribute indicating place serves vegetarian food.

    Declaration

    Swift

      var 
     servesVegetarianFood 
     : 
      GMSBooleanPlaceAttribute 
     
     { 
     get 
     } 
     
    

    Objective-C

      @property 
     ( 
     nonatomic 
     , 
     readonly 
     ) 
      GMSBooleanPlaceAttribute 
     
     servesVegetarianFood 
     ; 
     
    
  • Place Attribute indicating place is wheelchair accessible at the entrance.

    Declaration

    Swift

      var 
     wheelchairAccessibleEntrance 
     : 
      GMSBooleanPlaceAttribute 
     
     { 
     get 
     } 
     
    

    Objective-C

      @property 
     ( 
     nonatomic 
     , 
     readonly 
     ) 
      GMSBooleanPlaceAttribute 
     
     wheelchairAccessibleEntrance 
     ; 
     
    
  • Place Attribute indicating place is a pure service area business.

    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 may 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.

    Declaration

    Swift

      var 
     pureServiceAreaBusiness 
     : 
      GMSBooleanPlaceAttribute 
     
     { 
     get 
     } 
     
    

    Objective-C

      @property 
     ( 
     nonatomic 
     , 
     readonly 
     ) 
      GMSBooleanPlaceAttribute 
     
     pureServiceAreaBusiness 
     ; 
     
    
Create a Mobile Website
View Site in Mobile | Classic
Share by: