Last active
June 29, 2016 05:39
-
-
Save icanswiftabit/47e419ef9cd3eeb9ee1c to your computer and use it in GitHub Desktop.
Implementation of Equatable protocol
This file contains hidden or 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
class Category: Object,Equatable { | |
dynamic var id:String = "" | |
dynamic var name:String = "" | |
override static func primaryKey() -> String? { | |
return "id" | |
} | |
func config(id:String,name:String){ | |
self.id = id | |
self.name = name | |
} | |
func ==(_ lhs: Category, _ rhs: Category) -> Bool { | |
return lhs.id == rhs.id | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment