Created
July 13, 2017 13:39
-
-
Save guidomb/11ad26dbc7212b90d66b00af0e43affd to your computer and use it in GitHub Desktop.
Generic type safe object identifier in Swift
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
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