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:
structPoint:CustomStringConvertible{letx:Int,y:Intvardescription:String{return"(\(x), \(y))"}}letp=Point(x:21,y:30)lets=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.
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.
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.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-05-28 UTC."],[[["\u003cp\u003e\u003ccode\u003eTime\u003c/code\u003e is a struct in GooglePlacesSwift representing time in a 24-hour format, using hours and minutes.\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, enabling description, comparison, and hashing functionalities.\u003c/p\u003e\n"],["\u003cp\u003e\u003ccode\u003eTime\u003c/code\u003e provides properties like \u003ccode\u003ehour\u003c/code\u003e (0-23) and \u003ccode\u003eminute\u003c/code\u003e (0-59) to access the time components.\u003c/p\u003e\n"],["\u003cp\u003eDevelopers can utilize its conformance to protocols for operations like checking equality, creating textual representations, and using it in data structures requiring hashable elements.\u003c/p\u003e\n"]]],["The `Time` struct represents time using a 24-hour format, storing hours and minutes. It conforms to `CustomStringConvertible`, `Equatable`, and `Hashable`. Key features include: comparing `Time` instances for equality using `==`, providing a textual representation via `description`, hashing using `hash(into:)` for unique identification, retrieving the `hour` (0-23), and accessing the `minute` (0-59). It also includes a deprecated `hashValue` property.\n"],null,["Time \n\n struct Time\n\n extension Time : Copyable, CustomStringConvertible, Equatable, Escapable, Hashable, Sendable\n\nTime represents time in hours and minutes in a 24hr clock.\n- `\n ``\n ``\n `\n\n [==(_:_:)](#/s:17GooglePlacesSwift4TimeV2eeoiySbAC_ACtFZ)`\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 Swift \n\n static func == (lhs: Time, rhs: Time) -\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:17GooglePlacesSwift4TimeV11descriptionSSvp)`\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 Swift \n\n var description: String { get }\n\n- `\n ``\n ``\n `\n\n [hash(into:)](#/s:17GooglePlacesSwift4TimeV4hash4intoys6HasherVz_tF)`\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 Swift \n\n func hash(into hasher: inout Hasher)\n\n- `\n ``\n ``\n `\n\n [hashValue](#/s:17GooglePlacesSwift4TimeV9hashValueSivp)`\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/Time.html#/s:17GooglePlacesSwift4TimeV4hash4intoys6HasherVz_tF) requirement instead. The compiler provides an implementation for `hashValue` for you. \n\n Declaration \n Swift \n\n var hashValue: Int { get }\n\n- `\n ``\n ``\n `\n\n [hour](#/s:17GooglePlacesSwift4TimeV4hourSuvp)`\n ` \n The hour representation of time in a day. (Range is between 0-23). \n\n Declaration \n Swift \n\n var hour: UInt { get }\n\n- `\n ``\n ``\n `\n\n [minute](#/s:17GooglePlacesSwift4TimeV6minuteSuvp)`\n ` \n The minute representation of time in a 1 hr period. (Range is between 0-59). \n\n Declaration \n Swift \n\n var minute: UInt { get }"]]