Skip to content

Instantly share code, notes, and snippets.

@Dimillian
Last active November 17, 2017 14:02
Show Gist options
  • Save Dimillian/3142ee98ec92e387cff425e430a0b716 to your computer and use it in GitHub Desktop.
Save Dimillian/3142ee98ec92e387cff425e430a0b716 to your computer and use it in GitHub Desktop.
BooksCollectionDataProvider
protocol BooksCollectionDataProvider {
var title: String { get }
var datasource: [ObjectId] { get }
func loadData(paginationDelegate: PaginationDelegate)
}
class BaseBooksCollectionDataProvider: BooksCollectionDataProvider {
var title: String {
return "No configuration"
}
var datasource: [ObjectId] {
return []
}
func loadData(paginationDelegate: PaginationDelegate) {
assertionFailure("Don't use BaseBooksCollectionDataProvider directly, subclass your own")
}
let user: String
init(user: String) {
self.user = user
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment