TableCellViewModel

public protocol TableCellViewModel : DiffableViewModel, ReusableCellViewModelProtocol

View model for the individual cells of a TableViewModel.

  • TableViewDriver will automatically apply an accessibilityIdentifier to the cell based on this format.

    Declaration

    Swift

    var accessibilityFormat: CellAccessibilityFormat { get }
  • rowHeight Default implementation

    The height of this cell.

    Default Implementation

    Default implementation, returns nil.

    Note

    If nil, the TableViewDriver will fallback to TableViewModel.defaultRowHeight.

    See

    See also: TableViewModel

    Declaration

    Swift

    var rowHeight: CGFloat? { get }
  • editingStyle Default implementation

    The editing style for this cell.

    Default Implementation

    Default implementation, returns .none.

    Declaration

    Swift

    var editingStyle: UITableViewCell.EditingStyle { get }
  • shouldHighlight Default implementation

    Whether or not this cell should be highlighted.

    Default Implementation

    Default implementation, returns true.

    Declaration

    Swift

    var shouldHighlight: Bool { get }
  • shouldIndentWhileEditing Default implementation

    Whether or not this cell should be indented while editing.

    Default Implementation

    Default implementation, returns false.

    Declaration

    Swift

    var shouldIndentWhileEditing: Bool { get }
  • willBeginEditing Default implementation

    Invoked when a cell will begin being edited.

    Default Implementation

    Default implementation, returns nil.

    Declaration

    Swift

    var willBeginEditing: WillBeginEditingClosure? { get }
  • didEndEditing Default implementation

    Invoked when cell editing has ended.

    Default Implementation

    Default implementation, returns nil.

    Declaration

    Swift

    var didEndEditing: DidEndEditingClosure? { get }
  • commitEditingStyle Default implementation

    Asks the cell to commit the insertion/deletion.

    Default Implementation

    Default implementation, returns nil.

    Declaration

    Swift

    var commitEditingStyle: CommitEditingStyleClosure? { get }
  • didSelect Default implementation

    Invoked when a cell has been selected.

    Default Implementation

    Default implementation, returns nil.

    Declaration

    Swift

    var didSelect: DidSelectClosure? { get }
  • accessoryButtonTapped Default implementation

    Invoked when an accessory button is tapped.

    Default Implementation

    Default implementation, returns nil.

    Declaration

    Swift

    var accessoryButtonTapped: AccessoryButtonTappedClosure? { get }
  • Asks the cell model to update the UITableViewCell with the content in the cell model and return the updated cell.

    Declaration

    Swift

    func applyViewModelToCell(_ cell: UITableViewCell)

    Parameters

    cell

    the cell which contents need to be updated.