GooglePlacesSwift Framework Reference
Stay organized with collections
Save and categorize content based on your preferences.
AuthorAttribution
struct AuthorAttribution
extension AuthorAttribution : 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: AuthorAttribution, rhs: AuthorAttribution) -> 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 }
-
Returns the name of the author.
Declaration
Swift
var displayName: 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 }
-
Returns the AuthorAttribution
with a displayName, URL, and author photoURL.
Declaration
Swift
init(displayName: String, url: URL? = nil, photoUrl: URL? = nil)
-
Returns the profile photo URL of the author.
Declaration
Swift
var photoUrl: URL? { get }
-
Returns the URL of the author.
Declaration
Swift
var url: URL? { 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\u003e\u003ccode\u003eAuthorAttribution\u003c/code\u003e is a struct in GooglePlacesSwift that provides information about the author of a place review or photo.\u003c/p\u003e\n"],["\u003cp\u003eIt includes properties like \u003ccode\u003edisplayName\u003c/code\u003e, \u003ccode\u003eurl\u003c/code\u003e, and \u003ccode\u003ephotoUrl\u003c/code\u003e to represent the author's identity and online presence.\u003c/p\u003e\n"],["\u003cp\u003e\u003ccode\u003eAuthorAttribution\u003c/code\u003e conforms to \u003ccode\u003eCustomStringConvertible\u003c/code\u003e, \u003ccode\u003eEquatable\u003c/code\u003e, and \u003ccode\u003eHashable\u003c/code\u003e protocols for string representation, comparison, and hashing.\u003c/p\u003e\n"],["\u003cp\u003eYou can create an instance of \u003ccode\u003eAuthorAttribution\u003c/code\u003e by providing the author's display name, URL, and photo URL.\u003c/p\u003e\n"],["\u003cp\u003eIt also offers computed properties like \u003ccode\u003edescription\u003c/code\u003e and \u003ccode\u003ehashValue\u003c/code\u003e for convenient access to its attributes.\u003c/p\u003e\n"]]],["`AuthorAttribution` is a struct with properties for `displayName`, `url`, and `photoUrl`, providing information about an author. It supports equality checks (`==`), string descriptions, and hashing. Key actions include initializing with author details, retrieving the author's name, URL, and photo URL, and conforming to `CustomStringConvertible` and `Hashable` protocols. Hashing is achieved via the `hash(into:)` method.\n"],null,["# GooglePlacesSwift Framework Reference\n\nAuthorAttribution\n=================\n\n struct AuthorAttribution\n\n extension AuthorAttribution : Copyable, CustomStringConvertible, Equatable, Escapable, Hashable, Sendable\n\n- `\n ``\n ``\n `\n\n ### [==(_:_:)](#/s:17GooglePlacesSwift17AuthorAttributionV2eeoiySbAC_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: AuthorAttribution, rhs: AuthorAttribution) -\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 ### [description](#/s:17GooglePlacesSwift17AuthorAttributionV11descriptionSSvp)\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 ### [displayName](#/s:17GooglePlacesSwift17AuthorAttributionV11displayNameSSvp)\n\n `\n ` \n Returns the name of the author. \n\n #### Declaration\n\n Swift \n\n var displayName: String { get }\n\n- `\n ``\n ``\n `\n\n ### [hash(into:)](#/s:17GooglePlacesSwift17AuthorAttributionV4hash4intoys6HasherVz_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:17GooglePlacesSwift17AuthorAttributionV9hashValueSivp)\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/AuthorAttribution.html#/s:17GooglePlacesSwift17AuthorAttributionV4hash4intoys6HasherVz_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(displayName:url:photoUrl:)](#/s:17GooglePlacesSwift17AuthorAttributionV11displayName3url8photoUrlACSS_10Foundation3URLVSgAJtcfc)\n\n `\n ` \n Returns the `AuthorAttribution` with a displayName, URL, and author photoURL. \n\n #### Declaration\n\n Swift \n\n init(displayName: String, url: URL? = nil, photoUrl: URL? = nil)\n\n- `\n ``\n ``\n `\n\n ### [photoUrl](#/s:17GooglePlacesSwift17AuthorAttributionV8photoUrl10Foundation3URLVSgvp)\n\n `\n ` \n Returns the profile photo URL of the author. \n\n #### Declaration\n\n Swift \n\n var photoUrl: URL? { get }\n\n- `\n ``\n ``\n `\n\n ### [url](#/s:17GooglePlacesSwift17AuthorAttributionV3url10Foundation3URLVSgvp)\n\n `\n ` \n Returns the URL of the author. \n\n #### Declaration\n\n Swift \n\n var url: URL? { get }"]]