Created
April 19, 2020 17:04
-
-
Save FabP93/0efcc98c73c7d571239918a31e9e0b7d to your computer and use it in GitHub Desktop.
Hash example
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let key1 = Key(id: 1, title: "Key1") | |
let key2 = Key(id: 1, title: "Key2") | |
dict[key1] = 1058 | |
dict[key2] = 368 | |
print(dict.count) // 2 | |
print(key1 == key2) // false | |
print(key1.hashValue == key2.hashValue) // true |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment