Created
October 21, 2018 15:18
-
-
Save Oni-zerone/a0ef8391d4c6bf36c8fd695f0260ae65 to your computer and use it in GitHub Desktop.
An itemViewModel of a simple cell
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
struct StandardCellViewModel: ItemViewModel { | |
let title: String | |
var reuseIdentifier: String { | |
return "cell" | |
} | |
func setup(_ cell: UICollectionReusableView, in collectionView: UICollectionView, at indexPath: IndexPath) { | |
guard let cell = cell as? StandardCell else { | |
return | |
} | |
cell.titleLabel.text = self.title | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment