GooglePlacesSwift Framework Reference
Stay organized with collections
Save and categorize content based on your preferences.
PriceLevel
enum PriceLevel
extension PriceLevel : CaseIterable, Equatable, Hashable, Identifiable
The price level of a place.
-
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 == (a: PriceLevel, b: PriceLevel) -> Bool
-
A type that can represent a collection of all values of this type.
Declaration
Swift
typealias AllCases = [PriceLevel]
-
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 = PriceLevel
-
A collection of all values of this type.
Declaration
Swift
nonisolated static var allCases: [PriceLevel] { get }
-
Place provides expensive services.
-
Place provides free services.
-
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.
Declaration
Swift
var id: PriceLevel { get }
-
Place provides inexpensive services.
-
Place provides moderately priced services.
-
Place price level is unspecified or unknown.
-
Place provides very expensive services.
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\u003ePriceLevel\u003c/code\u003e is an enum in GooglePlacesSwift representing the price level of a place, ranging from free to very expensive.\u003c/p\u003e\n"],["\u003cp\u003eIt conforms to \u003ccode\u003eCaseIterable\u003c/code\u003e, \u003ccode\u003eEquatable\u003c/code\u003e, \u003ccode\u003eHashable\u003c/code\u003e, and \u003ccode\u003eIdentifiable\u003c/code\u003e protocols, enabling convenient operations like iterating through all cases and comparing values.\u003c/p\u003e\n"],["\u003cp\u003eIt includes cases like \u003ccode\u003efree\u003c/code\u003e, \u003ccode\u003einexpensive\u003c/code\u003e, \u003ccode\u003emoderate\u003c/code\u003e, \u003ccode\u003eexpensive\u003c/code\u003e, \u003ccode\u003everyExpensive\u003c/code\u003e, and \u003ccode\u003eunspecified\u003c/code\u003e to categorize price ranges.\u003c/p\u003e\n"],["\u003cp\u003eDevelopers can utilize this enum to filter or display places based on their price level, enhancing user experience by providing cost-related information.\u003c/p\u003e\n"]]],["`PriceLevel` is an enum representing the cost of a place's services, with cases like `free`, `inexpensive`, `moderate`, `expensive`, `veryExpensive`, and `unspecified`. It conforms to `CaseIterable`, `Equatable`, `Hashable`, and `Identifiable` protocols. Key actions include comparing two `PriceLevel` values for equality, obtaining all possible `PriceLevel` cases, retrieving a unique `id`, and hashing the `PriceLevel` value. Hashing requires the use of the function `hash(into:)` in the implementaion of the `Hashable` protocol.\n"],null,["# GooglePlacesSwift Framework Reference\n\nPriceLevel\n==========\n\n enum PriceLevel\n\n extension PriceLevel : CaseIterable, Equatable, Hashable, Identifiable\n\nThe price level of a place.\n- `\n ``\n ``\n `\n\n ### [==(_:_:)](#/s:17GooglePlacesSwift10PriceLevelO2eeoiySbAC_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 == (a: PriceLevel, b: PriceLevel) -\u003e Bool\n\n- `\n ``\n ``\n `\n\n ### [AllCases](#/s:17GooglePlacesSwift10PriceLevelO8AllCasesa)\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 = [PriceLevel]\n\n- `\n ``\n ``\n `\n\n ### [ID](#/s:17GooglePlacesSwift10PriceLevelO2IDa)\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 = PriceLevel\n\n- `\n ``\n ``\n `\n\n ### [allCases](#/s:17GooglePlacesSwift10PriceLevelO8allCasesSayACGvpZ)\n\n `\n ` \n A collection of all values of this type. \n\n #### Declaration\n\n Swift \n\n nonisolated static var allCases: [PriceLevel] { get }\n\n- `\n ``\n ``\n `\n\n ### [expensive](#/s:17GooglePlacesSwift10PriceLevelO9expensiveyA2CmF)\n\n `\n ` \n Place provides expensive services. \n\n #### Declaration\n\n Swift \n\n case expensive\n\n- `\n ``\n ``\n `\n\n ### [free](#/s:17GooglePlacesSwift10PriceLevelO4freeyA2CmF)\n\n `\n ` \n Place provides free services. \n\n #### Declaration\n\n Swift \n\n case free\n\n- `\n ``\n ``\n `\n\n ### [hash(into:)](#/s:17GooglePlacesSwift10PriceLevelO4hash4intoys6HasherVz_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:17GooglePlacesSwift10PriceLevelO9hashValueSivp)\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:)](../Enums/PriceLevel.html#/s:17GooglePlacesSwift10PriceLevelO4hash4intoys6HasherVz_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:17GooglePlacesSwift10PriceLevelO2idACvp)\n\n `\n ` \n The stable identity of the entity associated with this instance. \n\n #### Declaration\n\n Swift \n\n var id: PriceLevel { get }\n\n- `\n ``\n ``\n `\n\n ### [inexpensive](#/s:17GooglePlacesSwift10PriceLevelO11inexpensiveyA2CmF)\n\n `\n ` \n Place provides inexpensive services. \n\n #### Declaration\n\n Swift \n\n case inexpensive\n\n- `\n ``\n ``\n `\n\n ### [moderate](#/s:17GooglePlacesSwift10PriceLevelO8moderateyA2CmF)\n\n `\n ` \n Place provides moderately priced services. \n\n #### Declaration\n\n Swift \n\n case moderate\n\n- `\n ``\n ``\n `\n\n ### [unspecified](#/s:17GooglePlacesSwift10PriceLevelO11unspecifiedyA2CmF)\n\n `\n ` \n Place price level is unspecified or unknown. \n\n #### Declaration\n\n Swift \n\n case unspecified\n\n- `\n ``\n ``\n `\n\n ### [veryExpensive](#/s:17GooglePlacesSwift10PriceLevelO13veryExpensiveyA2CmF)\n\n `\n ` \n Place provides very expensive services. \n\n #### Declaration\n\n Swift \n\n case veryExpensive"]]