GooglePlacesSwift Framework Reference
Stay organized with collections
Save and categorize content based on your preferences.
Review
struct Review
extension Review : Copyable, CustomStringConvertible, Equatable, Escapable, Hashable, Sendable
-
Returns a Boolean value indicating whether two values are equal.
Equality is the inverse of inequality. For any values a
and b
,
a == b
implies that a != b
is false
.
Declaration
Swift
static func == (lhs: Review, rhs: Review) -> Bool
Parameters
lhs
|
|
rhs
|
Another value to compare.
|
-
-
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 custom
description
property for types that conform to
CustomStringConvertible
:
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 p
to a string in the assignment to s
uses the
Point
type’s description
property.
Declaration
Swift
var description: String { get }
-
Hashes the essential components of this value by feeding them into the
given hasher.
Implement this method to conform to the Hashable
protocol. The
components used for hashing must be the same as the components compared
in your type’s ==
operator implementation. Call hasher.combine(_:)
with each of these components.
Important
In your implementation of hash(into:)
,
don’t call finalize()
on the hasher
instance provided,
or replace it with a different instance.
Doing so may become a compile-time error in the future.
Declaration
Swift
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
hashValue
is deprecated as a
Hashable
requirement. To
conform to
Hashable
, implement the
hash(into:)
requirement instead.
The compiler provides an implementation for
hashValue
for you.
Declaration
Swift
var hashValue: Int { get }
-
Instantiates a Review
with detail properties.
Parameters:
- publishDate: The
Date
the review was published.
- relativePublishTimeDescription: The description of the publish time relative to the time
of the request.
- text: The localized text of the review.
- textLanguageCode: The language code of the localized review text.
- originalText: The review text in its original language.
- originalTextLanguageCode: The language code the review was originally written in.
- rating: The 0.0 - 5.0 rating associated with the review.
- authorAttribution: The
AuthorAttribution
of the review’s author.
Declaration
Swift
init(publishDate: Date, rating: Float, relativePublishDateDescription: String? = nil, text: String? = nil, textLanguageCode: String? = nil, originalText: String? = nil, originalTextLanguageCode: String? = nil, authorAttribution: AuthorAttribution? = nil)
Parameters
publishDate
|
The Date the review was published.
|
rating
|
The 0.0 - 5.0 rating associated with the review.
|
text
|
The localized text of the review.
|
textLanguageCode
|
The language code of the localized review text.
|
originalText
|
The review text in its original language.
|
originalTextLanguageCode
|
The language code the review was originally written in.
|
authorAttribution
|
|
-
The text of the review in its original language.
Declaration
Swift
var originalText: String? { get }
-
The language code of the original text of the review.
Declaration
Swift
var originalTextLanguageCode: String? { get }
-
The Date
the review was published.
Declaration
Swift
var publishDate: Date { get }
-
A whole number between 1.0 and 5.0, a.k.a. the number of stars.
Declaration
Swift
var rating: Float { get }
-
A formatted string expressing the review date/time relative to the current time. Specific to
the language and country (e.g. “6 months ago”).
Declaration
Swift
var relativePublishDateDescription: String? { get }
-
Declaration
Swift
var text: String? { get }
-
The language code of the text of the review.
Declaration
Swift
var textLanguageCode: String? { get }
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2025-08-27 UTC.
[null,null,["Last updated 2025-08-27 UTC."],[[["\u003cp\u003eThe \u003ccode\u003eReview\u003c/code\u003e struct encapsulates information about a Google Places review, including its rating, text, author attribution, and publish date.\u003c/p\u003e\n"],["\u003cp\u003eIt conforms to \u003ccode\u003eCustomStringConvertible\u003c/code\u003e, \u003ccode\u003eEquatable\u003c/code\u003e, and \u003ccode\u003eHashable\u003c/code\u003e protocols for easier manipulation and comparison.\u003c/p\u003e\n"],["\u003cp\u003e\u003ccode\u003eReview\u003c/code\u003e provides properties for accessing the review's content in its original and localized forms, along with associated language codes.\u003c/p\u003e\n"],["\u003cp\u003eIt includes a \u003ccode\u003erelativePublishDateDescription\u003c/code\u003e for displaying the review's age in a user-friendly format.\u003c/p\u003e\n"],["\u003cp\u003eDevelopers can instantiate a \u003ccode\u003eReview\u003c/code\u003e with detailed information about the review's attributes, such as publish date, rating, and author attribution.\u003c/p\u003e\n"]]],["The `Review` struct represents a user review, containing details such as `publishDate`, `rating` (1.0-5.0), and `relativePublishDateDescription`. It includes both localized `text` and the `originalText` of the review, along with their respective language codes. Each review has `authorAttribution`, and it can be compared for equality using `==`. It can be converted to a string through its `description`, and implement hashing for set and map operations through `hash(into:)`.\n"],null,["# GooglePlacesSwift Framework Reference\n\nReview\n======\n\n struct Review\n\n extension Review : Copyable, CustomStringConvertible, Equatable, Escapable, Hashable, Sendable\n\n- `\n ``\n ``\n `\n\n ### [==(_:_:)](#/s:17GooglePlacesSwift6ReviewV2eeoiySbAC_ACtFZ)\n\n `\n ` \n Returns a Boolean value indicating whether two values are equal.\n\n Equality is the inverse of inequality. For any values `a` and `b`,\n `a == b` implies that `a != b` is `false`. \n\n #### Declaration\n\n Swift \n\n static func == (lhs: Review, rhs: Review) -\u003e Bool\n\n #### Parameters\n\n |-------------|---------------------------|\n | ` `*lhs*` ` | A value to compare. |\n | ` `*rhs*` ` | Another value to compare. |\n\n- `\n ``\n ``\n `\n\n ### [authorAttribution](#/s:17GooglePlacesSwift6ReviewV17authorAttributionAA06AuthorF0VSgvp)\n\n `\n ` \n The attribution that must be shown to the user if this review is displayed.\n\n See [Other Attribution Requirements](https://developers.google.com/maps/documentation/places/ios-sdk/policies#other_attribution_requirements)\n for more details. \n\n #### Declaration\n\n Swift \n\n var authorAttribution: ../Structs/AuthorAttribution.html? { get }\n\n- `\n ``\n ``\n `\n\n ### [description](#/s:17GooglePlacesSwift6ReviewV11descriptionSSvp)\n\n `\n ` \n A textual representation of this instance.\n\n Calling this property directly is discouraged. Instead, convert an\n instance of any type to a string by using the `String(describing:)`\n initializer. This initializer works with any type, and uses the custom\n `description` property for types that conform to\n `CustomStringConvertible`: \n\n struct Point: CustomStringConvertible {\n let x: Int, y: Int\n\n var description: String {\n return \"(\\(x), \\(y))\"\n }\n }\n\n let p = Point(x: 21, y: 30)\n let s = String(describing: p)\n print(s)\n // Prints \"(21, 30)\"\n\n The conversion of `p` to a string in the assignment to `s` uses the\n `Point` type's `description` property. \n\n #### Declaration\n\n Swift \n\n var description: String { get }\n\n- `\n ``\n ``\n `\n\n ### [hash(into:)](#/s:17GooglePlacesSwift6ReviewV4hash4intoys6HasherVz_tF)\n\n `\n ` \n Hashes the essential components of this value by feeding them into the\n given hasher.\n\n Implement this method to conform to the `Hashable` protocol. The\n components used for hashing must be the same as the components compared\n in your type's `==` operator implementation. Call `hasher.combine(_:)`\n with each of these components. \n Important\n\n In your implementation of `hash(into:)`,\n don't call `finalize()` on the `hasher` instance provided,\n or replace it with a different instance.\n Doing so may become a compile-time error in the future. \n\n #### Declaration\n\n Swift \n\n func hash(into hasher: inout Hasher)\n\n- `\n ``\n ``\n `\n\n ### [hashValue](#/s:17GooglePlacesSwift6ReviewV9hashValueSivp)\n\n `\n ` \n The hash value.\n\n Hash values are not guaranteed to be equal across different executions of\n your program. Do not save hash values to use during a future execution. \n Important\n `hashValue` is deprecated as a `Hashable` requirement. To conform to `Hashable`, implement the [hash(into:)](../Structs/Review.html#/s:17GooglePlacesSwift6ReviewV4hash4intoys6HasherVz_tF) requirement instead. The compiler provides an implementation for `hashValue` for you. \n\n #### Declaration\n\n Swift \n\n var hashValue: Int { get }\n\n- `\n ``\n ``\n `\n\n ### [init(publishDate:rating:relativePublishDateDescription:text:textLanguageCode:originalText:originalTextLanguageCode:authorAttribution:)](#/s:17GooglePlacesSwift6ReviewV11publishDate6rating015relativePublishF11Description4text0K12LanguageCode12originalText0nolM017authorAttributionAC10Foundation0F0V_SfSSSgA4oA06AuthorQ0VSgtcfc)\n\n `\n ` \n Instantiates a `Review` with detail properties.\n\n Parameters:\n - publishDate: The `Date` the review was published.\n - relativePublishTimeDescription: The description of the publish time relative to the time of the request.\n - text: The localized text of the review.\n - textLanguageCode: The language code of the localized review text.\n - originalText: The review text in its original language.\n - originalTextLanguageCode: The language code the review was originally written in.\n - rating: The 0.0 - 5.0 rating associated with the review.\n - authorAttribution: The [AuthorAttribution](../Structs/AuthorAttribution.html) of the review's author. \n\n #### Declaration\n\n Swift \n\n init(publishDate: Date, rating: Float, relativePublishDateDescription: String? = nil, text: String? = nil, textLanguageCode: String? = nil, originalText: String? = nil, originalTextLanguageCode: String? = nil, authorAttribution: ../Structs/AuthorAttribution.html? = nil)\n\n #### Parameters\n\n |----------------------------------|------------------------------------------------------------------------------------|\n | ` `*publishDate*` ` | The `Date` the review was published. |\n | ` `*rating*` ` | The 0.0 - 5.0 rating associated with the review. |\n | ` `*text*` ` | The localized text of the review. |\n | ` `*textLanguageCode*` ` | The language code of the localized review text. |\n | ` `*originalText*` ` | The review text in its original language. |\n | ` `*originalTextLanguageCode*` ` | The language code the review was originally written in. |\n | ` `*authorAttribution*` ` | The [AuthorAttribution](../Structs/AuthorAttribution.html) of the review's author. |\n\n- `\n ``\n ``\n `\n\n ### [originalText](#/s:17GooglePlacesSwift6ReviewV12originalTextSSSgvp)\n\n `\n ` \n The text of the review in its original language. \n\n #### Declaration\n\n Swift \n\n var originalText: String? { get }\n\n- `\n ``\n ``\n `\n\n ### [originalTextLanguageCode](#/s:17GooglePlacesSwift6ReviewV24originalTextLanguageCodeSSSgvp)\n\n `\n ` \n The language code of the original text of the review. \n\n #### Declaration\n\n Swift \n\n var originalTextLanguageCode: String? { get }\n\n- `\n ``\n ``\n `\n\n ### [publishDate](#/s:17GooglePlacesSwift6ReviewV11publishDate10Foundation0F0Vvp)\n\n `\n ` \n The `Date` the review was published. \n\n #### Declaration\n\n Swift \n\n var publishDate: Date { get }\n\n- `\n ``\n ``\n `\n\n ### [rating](#/s:17GooglePlacesSwift6ReviewV6ratingSfvp)\n\n `\n ` \n A whole number between 1.0 and 5.0, a.k.a. the number of stars. \n\n #### Declaration\n\n Swift \n\n var rating: Float { get }\n\n- `\n ``\n ``\n `\n\n ### [relativePublishDateDescription](#/s:17GooglePlacesSwift6ReviewV30relativePublishDateDescriptionSSSgvp)\n\n `\n ` \n A formatted string expressing the review date/time relative to the current time. Specific to\n the language and country (e.g. \"6 months ago\"). \n\n #### Declaration\n\n Swift \n\n var relativePublishDateDescription: String? { get }\n\n- `\n ``\n ``\n `\n\n ### [text](#/s:17GooglePlacesSwift6ReviewV4textSSSgvp)\n\n `\n ` \n The text of the review. \n\n #### Declaration\n\n Swift \n\n var text: String? { get }\n\n- `\n ``\n ``\n `\n\n ### [textLanguageCode](#/s:17GooglePlacesSwift6ReviewV16textLanguageCodeSSSgvp)\n\n `\n ` \n The language code of the text of the review. \n\n #### Declaration\n\n Swift \n\n var textLanguageCode: String? { get }"]]