Skip to content

Instantly share code, notes, and snippets.

@nashysolutions
Created November 12, 2020 19:16
Show Gist options
  • Save nashysolutions/f67c08e42a08d29b4d99982939c3e8a2 to your computer and use it in GitHub Desktop.
Save nashysolutions/f67c08e42a08d29b4d99982939c3e8a2 to your computer and use it in GitHub Desktop.
extension MenuItem: Hashable, Comparable {
func hash(into hasher: inout Hasher) {
hasher.combine(name)
}
}
extension MenuItem: Comparable {
static func <(lhs: MenuItem, rhs: MenuItem) -> Bool {
return lhs.name < rhs.name
}
static func ==(lhs: MenuItem, rhs: MenuItem) -> Bool {
return lhs.name == rhs.name
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment