Calling this property directly is discouraged. Instead, convert an
instance of any type to a string by using theString(describing:)initializer. This initializer works with any type, and uses the customdescriptionproperty for types that conform toCustomStringConvertible:
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 ofpto a string in the assignment tosuses thePointtype’sdescriptionproperty.
Hashes the essential components of this value by feeding them into the
given hasher.
Implement this method to conform to theHashableprotocol. The
components used for hashing must be the same as the components compared
in your type’s==operator implementation. Callhasher.combine(_:)with each of these components.
Important
In your implementation ofhash(into:),
don’t callfinalize()on thehasherinstance 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
hashValueis deprecated as aHashablerequirement. To
conform toHashable, implement thehash(into:)requirement instead.
The compiler provides an implementation forhashValuefor 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-08-27 UTC."],[[["\u003cp\u003e\u003ccode\u003ePlusCode\u003c/code\u003e stores the Plus codes representation for a location, offering both global and compound code formats.\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 textual representation, comparison, and hashing functionalities.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003eglobalCode\u003c/code\u003e property provides the geo plus code (e.g., "8FVC9G8F+5W"), while the optional \u003ccode\u003ecompoundCode\u003c/code\u003e property gives a human-readable format (e.g., "9G8F+5W Zurich, Switzerland").\u003c/p\u003e\n"],["\u003cp\u003eYou can create a \u003ccode\u003ePlusCode\u003c/code\u003e instance using the designated initializer by providing the global code and, optionally, the compound code.\u003c/p\u003e\n"]]],[],null,["# GooglePlacesSwift Framework Reference\n\nPlusCode\n========\n\n struct PlusCode\n\n extension PlusCode : Copyable, CustomStringConvertible, Equatable, Escapable, Hashable, Sendable\n\nA class containing the Plus codes representation for a location.\n\nSee \u003chttps://plus.codes/\u003e for more details.\n- `\n ``\n ``\n `\n\n ### [==(_:_:)](#/s:17GooglePlacesSwift8PlusCodeV2eeoiySbAC_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: PlusCode, rhs: PlusCode) -\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 ### [compoundCode](#/s:17GooglePlacesSwift8PlusCodeV08compoundE0SSSgvp)\n\n `\n ` \n Compound plus code, e.g. \"9G8F+5W Zurich, Switzerland\" \n\n #### Declaration\n\n Swift \n\n var compoundCode: String? { get }\n\n- `\n ``\n ``\n `\n\n ### [description](#/s:17GooglePlacesSwift8PlusCodeV11descriptionSSvp)\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 ### [globalCode](#/s:17GooglePlacesSwift8PlusCodeV06globalE0SSvp)\n\n `\n ` \n Geo plus code, e.g. \"8FVC9G8F+5W\". \n\n #### Declaration\n\n Swift \n\n var globalCode: String { get }\n\n- `\n ``\n ``\n `\n\n ### [hash(into:)](#/s:17GooglePlacesSwift8PlusCodeV4hash4intoys6HasherVz_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:17GooglePlacesSwift8PlusCodeV9hashValueSivp)\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/PlusCode.html#/s:17GooglePlacesSwift8PlusCodeV4hash4intoys6HasherVz_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(globalCode:compoundCode:)](#/s:17GooglePlacesSwift8PlusCodeV06globalE008compoundE0ACSS_SSSgtcfc)\n\n `\n ` \n Instantiates a `PlusCode` with the specified information.\n\n This initializer can be used for testing. \n\n #### Declaration\n\n Swift \n\n init(globalCode: String, compoundCode: String? = nil)\n\n #### Parameters\n\n |----------------------|--------------------------------------------------------------------------|\n | ` `*globalCode*` ` | Geo plus code, e.g. \"8FVC9G8F+5W\". |\n | ` `*compoundCode*` ` | Compound plus code, e.g. \"9G8F+5W Zurich, Switzerland\". Defaults to nil. |\n\n #### Return Value\n\n A `PlusCode` containing the specified information."]]