Last active
October 21, 2018 15:11
-
-
Save Oni-zerone/675222691695b289089de4c6ca929560 to your computer and use it in GitHub Desktop.
A UICollectionViewDataSource that will use a ViewModel representation of the items inside the collection
This file contains 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 ItemViewModel { | |
var reuseIdentifier: String { get } | |
func setup(_ cell: UICollectionReusableView, in collectionView: UICollectionView, at indexPath: IndexPath) | |
} | |
protocol SectionViewModel { | |
var headerItem: ItemViewModel? { get } | |
var items: [ItemViewModel] { get } | |
var footer: ItemViewModel? { get } | |
func model(for elementOfKind: String) -> ItemViewModel? | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment