Skip to content

Instantly share code, notes, and snippets.

@guidomb
Created July 13, 2017 13:39
Show Gist options
  • Save guidomb/11ad26dbc7212b90d66b00af0e43affd to your computer and use it in GitHub Desktop.
Save guidomb/11ad26dbc7212b90d66b00af0e43affd to your computer and use it in GitHub Desktop.
Generic type safe object identifier in Swift
struct Identifier<ObjectType>: RawRepresentable, Hashable, Equatable {
let rawValue: String
init(rawValue: String) {
self.rawValue = rawValue
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment