-
Notifications
You must be signed in to change notification settings - Fork 30
Refactoring for ModelProtocol protocol #3
Comments
Hi, you are correct, public protocol ModelProtocol {
var hashValue: Int { get }
} Inside the diff functions are models are therefore casted to |
I've changed partially changed the approach to make it much cleaner. Each model of the cell must be conform to the A default implementation of this property is provided via |
Hi, @malcommac
Thank you for providing a nice library.
Please tell me about the implementation of
ModelProtocol
.If the object conforms to the
Equatable
protocol, i can use the default implementation ofExtension
so i do not need to writeisEqual
method.Likewise, if the object conforms to the
Hashable
protocol, i do not want to write theidentifier
property.Is there a problem with the code below?
It seems that compatibility is good.
Synthesizing Equatable and Hashable conformance
I think that implementation will be easier.
best regards.
The text was updated successfully, but these errors were encountered: