CollectionCellViewModel
public protocol CollectionCellViewModel : DiffableViewModel, ReusableCellViewModelProtocol
View model for the individual cells of a UICollectionView.
-
CollectionViewDriverwill automatically apply anaccessibilityIdentifierto the cell based on this formatDeclaration
Swift
var accessibilityFormat: CellAccessibilityFormat { get } -
shouldHighlightDefault implementationWhether or not this cell should be highlighted.
Default Implementation
Default implementation, returns
true.Declaration
Swift
var shouldHighlight: Bool { get } -
didSelectDefault implementationInvoked when a cell has been selected.
Default Implementation
Default implementation, returns
nil.Declaration
Swift
var didSelect: DidSelectClosure? { get } -
didDeselectDefault implementationInvoked when an accessory button is tapped.
Default Implementation
Default implementation, returns
nil.Declaration
Swift
var didDeselect: DidDeselectClosure? { get } -
Asks the cell model to update the
UICollectionViewCellwith the content in the cell model and return the updated cell.Declaration
Swift
func applyViewModelToCell(_ cell: UICollectionViewCell)Parameters
cellthe cell which’s content need to be updated.
View on GitHub
CollectionCellViewModel Protocol Reference