ViewModelMapping

extension ViewModelMapping where View: UITableViewCell
extension ViewModelMapping where View: UITableViewHeaderFooterView

Available where View: UITableViewCell

  • Registers closure to be executed, when UITableViewDelegate.tableView(_:canMoveRowAt:) method is called.

    Declaration

    Swift

    open func canMove(_ closure: @escaping (View, Model, IndexPath) -> Bool)
  • Registers closure to be executed, when UITableViewDelegate.tableView(_:moveRowAt:to:) method is called.

    Warning

    This method requires items to be moved without animations, since animation has already happened when user moved those cells. If you use MemoryStorage, it’s appropriate to call memoryStorage.moveItemWithoutAnimation(from:to:) method to achieve desired behavior.

    See also

    ‘tableView:moveRowAt:to:’ method

    Declaration

    Swift

    open func moveRowTo(_ closure: @escaping (_ destinationIndexPath: IndexPath, View, Model, _ sourceIndexPath: IndexPath) -> Void)
  • Registers closure to be executed, when UITableViewDelegate.tableView(_:commitEditingStyle:forRowAt:) method is called.

    Declaration

    Swift

    open func commitEditingStyle(_ closure: @escaping (UITableViewCell.EditingStyle, View, Model, IndexPath) -> Void)
  • Registers closure to be executed in UITableViewDelegate.tableView(_:canEditCellForRowAt:) method, when it’s called.

    Declaration

    Swift

    open func canEditCell(_ closure: @escaping (Model, IndexPath) -> Bool)
  • Registers closure to be executed, when UITableViewDelegate.tableView(_:didSelectRowAt:) method is called.

    Declaration

    Swift

    open func didSelect(_ closure: @escaping (View, Model, IndexPath) -> Void)
  • Registers closure to be executed, when UITableViewDelegate.tableView(_:willSelectRowAt:) method is called.

    Declaration

    Swift

    open func willSelect(_ closure: @escaping (View, Model, IndexPath) -> IndexPath?)
  • Registers closure to be executed, when UITableViewDelegate.tableView(_:willDeselectRowAt:) method is called.

    Declaration

    Swift

    open func willDeselect(_ closure: @escaping (View, Model, IndexPath) -> IndexPath?)
  • Registers closure to be executed, when UITableViewDelegate.tableView(_:didDeselectRowAt:) method is called.

    Declaration

    Swift

    open func didDeselect(_ closure: @escaping (View, Model, IndexPath) -> Void)
  • Registers closure to be executed to determine cell height in UITableViewDelegate.tableView(_:heightForRowAt:) method, when it’s called.

    Declaration

    Swift

    open func heightForCell(_ closure: @escaping (Model, IndexPath) -> CGFloat)
  • Registers closure to be executed to determine estimated cell height in UITableViewDelegate.tableView(_:estimatedHeightForRowAt:) method, when it’s called.

    Declaration

    Swift

    open func estimatedHeightForCell(_ closure: @escaping (Model, IndexPath) -> CGFloat)
  • Registers closure to be executed to determine indentation level in UITableViewDelegate.tableView(_:indentationLevelForRowAt:) method, when it’s called.

    Declaration

    Swift

    open func indentationLevelForCell(_ closure: @escaping (Model, IndexPath) -> Int)
  • Registers closure to be executed, when UITableViewDelegate.tableView(_:willDisplayCell:forRowAt:) method is called.

    Declaration

    Swift

    open func willDisplay(_ closure: @escaping (View, Model, IndexPath) -> Void)
  • Registers closure to be executed, when UITableViewDelegate.tableView(_:accessoryButtonTappedForRowAt:) method is called.

    Declaration

    Swift

    open func accessoryButtonTapped(_ closure: @escaping (View, Model, IndexPath) -> Void)
  • Registers closure to be executed, when UITableViewDelegate.tableView(_:willBeginEditingRowAt:) method is called.

    Declaration

    Swift

    open func willBeginEditing(_ closure: @escaping (View, Model, IndexPath) -> Void)
  • Registers closure to be executed, when UITableViewDelegate.tableView(_:didEndEditingRowAt:) method is called.

    Declaration

    Swift

    open func didEndEditing(_ closure: @escaping (View, Model, IndexPath) -> Void)
  • Registers closure to be executed, when UITableViewDelegate.tableView(_:titleForDeleteConfirmationButtonForRowAt:) method is called.

    Declaration

    Swift

    open func titleForDeleteConfirmationButton(_ closure: @escaping (View, Model, IndexPath) -> String?)
  • Registers closure to be executed, when UITableViewDelegate.tableView(_:editingStyleForRowAt:) method is called.

    Declaration

    Swift

    open func editingStyle(_ closure: @escaping (Model, IndexPath) -> UITableViewCell.EditingStyle)
  • Registers closure to be executed, when UITableViewDelegate.tableView(_:shouldIndentWhileEditingRowAt:) method is called.

    Declaration

    Swift

    open func shouldIndentWhileEditing(_ closure: @escaping (View, Model, IndexPath) -> Bool)
  • Registers closure to be executed, when UITableViewDelegate.tableView(_:didEndDisplayingCell:forRowAt:) method is called.

    Declaration

    Swift

    open func didEndDisplaying(_ closure: @escaping (View, Model, IndexPath) -> Void)
  • Registers closure to be executed, when UITableViewDelegate.tableView(_:shouldHighlightRowAt:) method is called.

    Declaration

    Swift

    open func shouldHighlight(_ closure: @escaping (View, Model, IndexPath) -> Bool)
  • Registers closure to be executed, when UITableViewDelegate.tableView(_:didHighlightRowAt:) method is called.

    Declaration

    Swift

    open func didHighlight(_ closure: @escaping (View, Model, IndexPath) -> Void)
  • Registers closure to be executed, when UITableViewDelegate.tableView(_:didUnhighlightRowAt:) method is called.

    Declaration

    Swift

    open func didUnhighlight(_ closure: @escaping (View, Model, IndexPath) -> Void)
  • Registers closure to be executed, when UITableViewDelegate.tableView(_:canFocusRowAt:) method is called.

    Declaration

    Swift

    open func canFocus(_ closure: @escaping (View, Model, IndexPath) -> Bool)
  • Registers closure to be executed when UITableViewDelegate.targetIndexPathForMoveFromRowAt(_:toProposed:) method is called.

    Declaration

    Swift

    open func targetIndexPathForMove(_ closure: @escaping (IndexPath, View, Model, IndexPath) -> IndexPath)
  • Registers closure to be executed when UITableViewDelegate.tableView(_:leadingSwipeActionsConfigurationForRowAt:) method is called.

    Declaration

    Swift

    open func leadingSwipeActionsConfiguration(_ closure: @escaping (View, Model, IndexPath) -> UISwipeActionsConfiguration?)
  • Registers closure to be executed when UITableViewDelegate.tableView(_:trailingSwipeActionsConfigurationForRowAt:) method is called.

    Declaration

    Swift

    open func trailingSwipeActionsConfiguration(_ closure: @escaping (View, Model, IndexPath) -> UISwipeActionsConfiguration?)
  • Registers closure to be executed when UITableViewDelegate.tableView(_:shouldSpringLoadRowAt:) method is called.

    Declaration

    Swift

    open func shouldSpringLoad(_ closure: @escaping (UISpringLoadedInteractionContext, View, Model, IndexPath) -> Bool)
  • Undocumented

    Declaration

    Swift

    open func shouldBeginMultipleSelectionInteraction(_ closure: @escaping (View, Model, IndexPath) -> Bool)
  • Undocumented

    Declaration

    Swift

    open func didBeginMultipleSelectionInteraction(_ closure: @escaping (View, Model, IndexPath) -> Void)
  • Undocumented

    Declaration

    Swift

    open func contextMenuConfiguration(_ closure: @escaping (CGPoint, View, Model, IndexPath) -> UIContextMenuConfiguration?)

Available where View: UITableViewHeaderFooterView

  • Registers closure to be executed to determine header height in UITableViewDelegate.tableView(_:heightForHeaderInSection:) method is called.

    Declaration

    Swift

    open func heightForHeader(_ closure: @escaping (Model, Int) -> CGFloat)
  • Registers closure to be executed to determine estimated header height in UITableViewDelegate.tableView(_:estimatedHeightForHeaderInSection:) method is called.

    Declaration

    Swift

    open func estimatedHeightForHeader(_ closure: @escaping (Model, Int) -> CGFloat)
  • Registers closure to be executed to determine footer height in UITableViewDelegate.tableView(_:heightForFooterInSection:) method is called.

    Declaration

    Swift

    open func heightForFooter(_ closure: @escaping (Model, Int) -> CGFloat)
  • Registers closure to be executed to determine estimated footer height in UITableViewDelegate.tableView(_:estimatedHeightForFooterInSection:) method is called.

    Declaration

    Swift

    open func estimatedHeightForFooter(_ closure: @escaping (Model, Int) -> CGFloat)
  • Registers closure to be executed, when UITableViewDelegate.tableView(_:willDisplayHeaderView:forSection:) method is called.

    Declaration

    Swift

    open func willDisplayHeaderView(_ closure: @escaping (View, Model, Int) -> Void)
  • Registers closure to be executed, when UITableViewDelegate.tableView(_:willDisplayFooterView:forSection:) method is called.

    Declaration

    Swift

    open func willDisplayFooterView(_ closure: @escaping (View, Model, Int) -> Void)
  • Registers closure to be executed, when UITableViewDelegate.tableView(_:didEndDisplayingHeaderView:forSection:) method is called.

    Declaration

    Swift

    open func didEndDisplayingHeaderView(_ closure: @escaping (View, Model, Int) -> Void)
  • Registers closure to be executed, when UITableViewDelegate.tableView(_:didEndDisplayingFooterView:forSection:) method is called.

    Declaration

    Swift

    open func didEndDisplayingFooterView(_ closure: @escaping (View, Model, Int) -> Void)

Available where View: UITableViewCell

  • Registers closure to be executed when UITableViewDragDelegate.tableView(_:itemsForBeginning:at:) method is called.

    Declaration

    Swift

    open func itemsForBeginningDragSession(_ closure: @escaping (UIDragSession, View, Model, IndexPath) -> [UIDragItem])
  • Registers closure to be executed when UITableViewDragDelegate.tableView(_:itemsForAddingTo:at:point:) method is called.

    Declaration

    Swift

    open func itemsForAddingToDragSession(_ closure: @escaping (UIDragSession, CGPoint, View, Model, IndexPath) -> [UIDragItem])
  • Registers closure to be executed when UITableViewDragDelegate.tableView(_:dragPreviewParametersForRowAt:) method is called.

    Declaration

    Swift

    open func dragPreviewParameters(_ closure: @escaping (View, Model, IndexPath) -> UIDragPreviewParameters?)