Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR SWIFT

Swift Hashable Protocol

struct Employee: Hashable {
  var name: String
}

let object1 = Employee(name: "Sabby")
let object2 = Employee(name: "Smith")

// print hash values
print(object1.hashValue)
print(object2.hashValue)
 
PREVIOUS NEXT
Tagged: #Swift #Hashable #Protocol
ADD COMMENT
Topic
Name
5+9 =