GooglePlacesSwift Framework Reference
Stay organized with collections
Save and categorize content based on your preferences.
RankPreference
enum RankPreference
extension SearchNearbyRequest.RankPreference : CaseIterable, Equatable, Hashable, Identifiable, Sendable
How results will be ranked in the response.
-
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
.
-
A type that can represent a collection of all values of this type.
-
A type representing the stable identity of the entity associated with
an instance.
Declaration
Swift
@available(watchOS, introduced: 6.0)
@available(macOS, introduced: 10.15)
@available(iOS, introduced: 13.0)
@available(tvOS, introduced: 13.0)
typealias ID = SearchNearbyRequest.RankPreference
-
A collection of all values of this type.
-
-
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 }
-
The stable identity of the entity associated with this instance.
-
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\u003eRankPreference\u003c/code\u003e is an enum used to specify how results are ranked in a Google Places Nearby Search.\u003c/p\u003e\n"],["\u003cp\u003eIt offers two options: ranking by \u003ccode\u003edistance\u003c/code\u003e or by \u003ccode\u003epopularity\u003c/code\u003e.\u003c/p\u003e\n"],["\u003cp\u003e\u003ccode\u003eRankPreference\u003c/code\u003e conforms to \u003ccode\u003eCaseIterable\u003c/code\u003e, \u003ccode\u003eEquatable\u003c/code\u003e, \u003ccode\u003eHashable\u003c/code\u003e, and \u003ccode\u003eIdentifiable\u003c/code\u003e protocols, providing functionalities like iterating through all cases and comparing instances.\u003c/p\u003e\n"],["\u003cp\u003eIt includes computed properties like \u003ccode\u003eallCases\u003c/code\u003e and \u003ccode\u003eid\u003c/code\u003e for accessing all possible rank preferences and identifying a specific instance.\u003c/p\u003e\n"]]],["The `RankPreference` enum dictates how search results are ranked, offering options like `distance` and `popularity`. It conforms to `CaseIterable`, `Equatable`, `Hashable`, and `Identifiable` protocols. Key functionalities include checking equality (`==`), accessing all cases (`allCases`), and providing a unique identifier (`id`). It can be used to hash its values, and it also offers the deprecated property `hashValue`. The all cases can be called via the static variable allCases.\n"],null,["# GooglePlacesSwift Framework Reference\n\nRankPreference\n==============\n\n enum RankPreference\n\n extension ../../Structs/SearchNearbyRequest.html.RankPreference : CaseIterable, Equatable, Hashable, Identifiable, Sendable\n\nHow results will be ranked in the response.\n- `\n ``\n ``\n `\n\n ### [==(_:_:)](#/s:17GooglePlacesSwift19SearchNearbyRequestV14RankPreferenceO2eeoiySbAE_AEtFZ)\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 == (a: ../../Structs/SearchNearbyRequest.html.RankPreference, b: ../../Structs/SearchNearbyRequest.html.RankPreference) -\u003e Bool\n\n- `\n ``\n ``\n `\n\n ### [AllCases](#/s:17GooglePlacesSwift19SearchNearbyRequestV14RankPreferenceO8AllCasesa)\n\n `\n ` \n A type that can represent a collection of all values of this type. \n\n #### Declaration\n\n Swift \n\n typealias AllCases = [../../Structs/SearchNearbyRequest.html.RankPreference]\n\n- `\n ``\n ``\n `\n\n ### [ID](#/s:17GooglePlacesSwift19SearchNearbyRequestV14RankPreferenceO2IDa)\n\n `\n ` \n A type representing the stable identity of the entity associated with\n an instance. \n\n #### Declaration\n\n Swift \n\n @available(watchOS, introduced: 6.0)\n @available(macOS, introduced: 10.15)\n @available(iOS, introduced: 13.0)\n @available(tvOS, introduced: 13.0)\n typealias ID = ../../Structs/SearchNearbyRequest.html.RankPreference\n\n- `\n ``\n ``\n `\n\n ### [allCases](#/s:17GooglePlacesSwift19SearchNearbyRequestV14RankPreferenceO8allCasesSayAEGvpZ)\n\n `\n ` \n A collection of all values of this type. \n\n #### Declaration\n\n Swift \n\n nonisolated static var allCases: [../../Structs/SearchNearbyRequest.html.RankPreference] { get }\n\n- `\n ``\n ``\n `\n\n ### [distance](#/s:17GooglePlacesSwift19SearchNearbyRequestV14RankPreferenceO8distanceyA2EmF)\n\n `\n ` \n\n #### Declaration\n\n Swift \n\n case distance\n\n- `\n ``\n ``\n `\n\n ### [hash(into:)](#/s:17GooglePlacesSwift19SearchNearbyRequestV14RankPreferenceO4hash4intoys6HasherVz_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:17GooglePlacesSwift19SearchNearbyRequestV14RankPreferenceO9hashValueSivp)\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/SearchNearbyRequest/RankPreference.html#/s:17GooglePlacesSwift19SearchNearbyRequestV14RankPreferenceO4hash4intoys6HasherVz_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 ### [id](#/s:17GooglePlacesSwift19SearchNearbyRequestV14RankPreferenceO2idAEvp)\n\n `\n ` \n The stable identity of the entity associated with this instance. \n\n #### Declaration\n\n Swift \n\n var id: ../../Structs/SearchNearbyRequest.html.RankPreference { get }\n\n- `\n ``\n ``\n `\n\n ### [popularity](#/s:17GooglePlacesSwift19SearchNearbyRequestV14RankPreferenceO10popularityyA2EmF)\n\n `\n ` \n\n #### Declaration\n\n Swift \n\n case popularity"]]