Skip to content

Instantly share code, notes, and snippets.

@AviTsadok
Created July 19, 2019 10:21
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save AviTsadok/2115f33e0b122d5fad8224aa96ac7a95 to your computer and use it in GitHub Desktop.
Save AviTsadok/2115f33e0b122d5fad8224aa96ac7a95 to your computer and use it in GitHub Desktop.
DiffableDataSource models
import Foundation
enum Section {
case today
case tomorrow
case upcoming
case someday
}
struct Item : Hashable {
var id = ""
var data = ""
func hash(into hasher: inout Hasher) {
hasher.combine(id)
}
static func == (lhs: Item, rhs: Item) -> Bool {
return lhs.id == rhs.id
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment