Created
August 7, 2017 15:12
-
-
Save loucimj/ebdafc0387bd12c037e7127e8a9b4ddf to your computer and use it in GitHub Desktop.
Customizing structs to use Diffable
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
extension TicketShort: Diffable { | |
var diffIdentifier: String { | |
return id | |
} | |
static func ==(lhs: TicketShort, rhs: TicketShort) -> Bool { | |
return lhs.id == rhs.id | |
} | |
func diffable() -> ListDiffable { | |
return DiffableBox(value: self, identifier: self.diffIdentifier as NSObjectProtocol, equal: ==) | |
} | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment