AI-generated Key Takeaways
- 
          Placeis an immutable class in GooglePlacesSwift representing a physical location with details like name, location, and other relevant information.
- 
          It provides structured address components, formatted address, place ID, location coordinates, rating, user reviews, photos, and more. 
- 
          Placeincludes attributes like business status, opening hours, price level, accessibility options, and various service indicators (e.g., dine-in, takeout).
- 
          It offers data provider attributions that should be displayed to users according to the Places SDK Terms of Service. 
- 
          Developers can use Placeto access and display comprehensive information about a physical place within their applications.
Place
struct Placeextension Place : Copyable, CustomStringConvertible, Equatable, Escapable, Hashable, PlaceProtocol, SendableRepresents a particular physical place.
A Place encapsulates information about a physical location, including its name, location, and
any other information we might have about it. This class is immutable.
- 
                  
                  Returns a Boolean value indicating whether two values are equal. Equality is the inverse of inequality. For any values aandb,a == bimplies thata != bisfalse.DeclarationSwift static func == (lhs: Place, rhs: Place) -> BoolParameterslhsA value to compare. rhsAnother value to compare. 
- 
                  
                  Place Attribute indicating place is wheelchair accessible at the entrance. DeclarationSwift var accessibilityOptions: AccessibilityOptions? { get }
- 
                  
                  An array of AddressComponentobjects 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 formattedAddressproperty.DeclarationSwift var addressComponents: [AddressComponent]? { get }
- 
                  
                  The data provider attribution string for this place. These are provided as an AttributedString, which may contain hyperlinks to the website of each provider. In general, these must be shown to the user if data from this Placeis shown, as described in the Places SDK Terms of Service.DeclarationSwift var attributions: AttributedString? { get }
- 
                  
                  The BusinessStatusof the place.DeclarationSwift var businessStatus: BusinessStatus { get }
- 
                  
                  The consumer alert for this place. DeclarationSwift var consumerAlert: ConsumerAlert? { get }
- 
                  
                  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. SpecialDayentries onOpeningHourswill only be present forPlacecurrentOpeningHoursandPlacesecondaryOpeningHours.DeclarationSwift var currentOpeningHours: OpeningHours? { get }
- 
                  
                  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 HoursTypefor the different types of secondary hours.SpecialDayentries onOpeningHourswill only be present forPlacecurrentOpeningHoursandPlacecurrentSecondaryOpeningHours.DeclarationSwift var currentSecondaryOpeningHours: [OpeningHours]? { get }
- 
                  
                  A textual representation of this instance. Calling this property directly is discouraged. Instead, convert an instance of any type to a string by using the String(describing:)initializer. This initializer works with any type, and uses the customdescriptionproperty for types that conform toCustomStringConvertible:struct Point: CustomStringConvertible { let x: Int, y: Int var description: String { return "(\(x), \(y))" } } let p = Point(x: 21, y: 30) let s = String(describing: p) print(s) // Prints "(21, 30)"The conversion of pto a string in the assignment tosuses thePointtype’sdescriptionproperty.DeclarationSwift var description: String { get }
- 
                  
                  Name of the place. DeclarationSwift var displayName: String? { get }
- 
                  
                  Returns this place’s editorial summary. DeclarationSwift var editorialSummary: String? { get }
- 
                  
                  The ev charge amenity summary for this place. DeclarationSwift var evChargeAmenitySummary: EVChargeAmenitySummary? { get }
- 
                  
                  The EV charging options for this place. DeclarationSwift var evChargeOptions: EVChargeOptions? { get }
- 
                  
                  A string containing the human-readable address of this place. Often this address is equivalent to the postal address. Note that some countries, such as the United Kingdom, do not allow distribution of true postal addresses due to licensing restrictions. The formatted address is logically composed of one or more address components. For example, the address “111 8th Avenue, New York, NY” consists of the following components: “111” (the street number), “8th Avenue” (the route), “New York” (the city) and “NY” (the US state). Do not parse the formatted address programmatically. Instead you should use the individual address components, which the API response includes in addition to the formatted address field. DeclarationSwift var formattedAddress: String? { get }
- 
                  
                  The generative summary for this place. DeclarationSwift var generativeSummary: GenerativeSummary? { get }
- 
                  
                  DeclarationSwift var hash: Int { get }
- 
                  
                  Hashes the essential components of this value by feeding them into the given hasher. Implement this method to conform to the Hashableprotocol. The components used for hashing must be the same as the components compared in your type’s==operator implementation. Callhasher.combine(_:)with each of these components.Important In your implementation of hash(into:), don’t callfinalize()on thehasherinstance provided, or replace it with a different instance. Doing so may become a compile-time error in the future.DeclarationSwift func hash(into hasher: inout Hasher)
- 
                  
                  The hash value. Hash values are not guaranteed to be equal across different executions of your program. Do not save hash values to use during a future execution. Important hashValueis deprecated as aHashablerequirement. To conform toHashable, implement thehash(into:)requirement instead. The compiler provides an implementation forhashValuefor you.DeclarationSwift var hashValue: Int { get }
- 
                  
                  Background color of the icon according to Place type, to color the view behind the icon. DeclarationSwift var iconBackgroundColor: UIColor? { get }
- 
                  
                  The URL to a PNG icon mask. Note URL link does not expire and the image size aspect ratio may be different depending on type.DeclarationSwift var iconMaskURL: URL? { get }
- 
                  
                  The 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”. DeclarationSwift var internationalPhoneNumber: String? { get }
- 
                  
                  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 do not have a physical address or location on Google Maps. DeclarationSwift var isPureServiceAreaBusiness: Bool? { get }
- 
                  
                  Place Attribute indicating place is popular with tourists. DeclarationSwift var isReservable: Bool? { get }
- 
                  
                  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 Placeis shown, as described in the Places SDK Terms of Service.DeclarationSwift var legacyAttributions: NSAttributedString? { get }
- 
                  
                  The location coordinates 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. DeclarationSwift var location: CLLocationCoordinate2D { get }
- 
                  
                  The neighborhood summary for this place. DeclarationSwift var neighborhoodSummary: NeighborhoodSummary? { get }
- 
                  
                  Represents how many reviews make up this place’s rating. DeclarationSwift var numberOfUserRatings: Int { get }
- 
                  
                  The parking options for this place. DeclarationSwift var parkingOptions: ParkingOptions? { get }
- 
                  
                  Place ID of this place. DeclarationSwift var placeID: String? { get }
- 
                  
                  The Plus code representation of location for this place. DeclarationSwift var plusCode: PlusCode? { get }
- 
                  
                  Price level for this place. DeclarationSwift var priceLevel: PriceLevel { get }
- 
                  
                  Five-star rating for this place based on user reviews. Ratings range from 1.0 to 5.0. nil if we have no rating for this place (e.g. because not enough users have reviewed this place). DeclarationSwift var rating: Float? { get }
- 
                  
                  The normal business Opening Hours information for this place. Includes open status, periods and weekday text when available. DeclarationSwift var regularOpeningHours: OpeningHours? { get }
- 
                  
                  The review summary for this place. DeclarationSwift var reviewSummary: ReviewSummary? { get }
- 
                  
                  Place Attribute indicating place serves beer. DeclarationSwift var servesBeer: Bool? { get }
- 
                  
                  Place Attribute indicating place serves breakfast. DeclarationSwift var servesBreakfast: Bool? { get }
- 
                  
                  Place Attribute indicating place serves brunch. DeclarationSwift var servesBrunch: Bool? { get }
- 
                  
                  Place Attribute indicating place serves dinner. DeclarationSwift var servesDinner: Bool? { get }
- 
                  
                  Place Attribute indicating place serves lunch. DeclarationSwift var servesLunch: Bool? { get }
- 
                  
                  Place Attribute indicating place serves vegetarian food. DeclarationSwift var servesVegetarianFood: Bool? { get }
- 
                  
                  Place Attribute indicating place serves wine. DeclarationSwift var servesWine: Bool? { get }
- 
                  
                  Place Attribute for curbside pickup services. DeclarationSwift var supportsCurbsidePickup: Bool? { get }
- 
                  
                  Place Attribute for delivery services. DeclarationSwift var supportsDelivery: Bool? { get }
- 
                  
                  Place Attribute for dine in experience. DeclarationSwift var supportsDineIn: Bool? { get }
- 
                  
                  Place Attribute for takeout experience. DeclarationSwift var supportsTakeout: Bool? { get }
- 
                  
                  The timezone UTC offset of the place in minutes. DeclarationSwift var timeZone: TimeZone? { get }
- 
                  
                  The types of this place. Types are PlaceType, whose raw string values are any types documented at https://developers.google.com/places/ios-sdk/supported_types. DeclarationSwift var types: Set<PlaceType> { get }
- 
                  
                  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 Placeobject representing a store may have a relatively small viewport, while aPlaceobject representing a country may have a very large viewport.DeclarationSwift var viewportInfo: RectangularCoordinateRegion? { get }
- 
                  
                  The website for this place. DeclarationSwift var websiteURL: URL? { get }