Skip to content

Instantly share code, notes, and snippets.

@icanswiftabit
Last active June 29, 2016 05:39
Show Gist options
  • Save icanswiftabit/47e419ef9cd3eeb9ee1c to your computer and use it in GitHub Desktop.
Save icanswiftabit/47e419ef9cd3eeb9ee1c to your computer and use it in GitHub Desktop.
Implementation of Equatable protocol
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