Skip to content

Instantly share code, notes, and snippets.

@Oni-zerone
Created October 21, 2018 15:18
Show Gist options
  • Save Oni-zerone/a0ef8391d4c6bf36c8fd695f0260ae65 to your computer and use it in GitHub Desktop.
Save Oni-zerone/a0ef8391d4c6bf36c8fd695f0260ae65 to your computer and use it in GitHub Desktop.
An itemViewModel of a simple cell
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