Last active
November 17, 2017 14:02
-
-
Save Dimillian/3142ee98ec92e387cff425e430a0b716 to your computer and use it in GitHub Desktop.
BooksCollectionDataProvider
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
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