DTTableViewManager

open class DTTableViewManager

DTTableViewManager manages many of UITableView datasource and delegate methods and provides API for managing your data models in the table. Any method, that is not implemented by DTTableViewManager, will be forwarded to delegate.

See also

startManagingWithDelegate:
  • Stores all configuration options for DTTableViewManager.

    Declaration

    Swift

    open var configuration: TableViewConfiguration
  • Anomaly handler, that handles reported by DTTableViewManager anomalies.

    Declaration

    Swift

    open var anomalyHandler: DTTableViewManagerAnomalyHandler
  • Bool property, that will be true, after startManagingWithDelegate method is called on DTTableViewManager.

    Declaration

    Swift

    open var isManagingTableView: Bool { get }
  • Implicitly unwrap storage property to MemoryStorage.

    Warning

    if storage is not MemoryStorage, will throw an exception.

    Declaration

    Swift

    open var memoryStorage: MemoryStorage! { get }
  • Storage, that holds your UITableView models. By default, it’s MemoryStorage instance.

    Note

    When setting custom storage for this property, it will be automatically configured for using with UITableView and it’s delegate will be set to DTTableViewManager instance.

    Note

    Previous storage delegate property will be nilled out to avoid collisions.

    See also

    MemoryStorage, CoreDataStorage, RealmStorage.

    Declaration

    Swift

    open var storage: Storage { get set }
  • Current storage, conditionally casted to SupplementaryStorage protocol.

    Declaration

    Swift

    public var supplementaryStorage: SupplementaryStorage? { get }
  • Object, that is responsible for updating UITableView, when received update from Storage

    Declaration

    Swift

    open var tableViewUpdater: TableViewUpdater? { get set }
  • Object, that is responsible for implementing UITableViewDelegate protocol.

    Declaration

    Swift

    open var tableDelegate: DTTableViewDelegate? { get set }
  • Object, that is responsible for implementing UITableViewDataSource protocol.

    Declaration

    Swift

    open var tableDataSource: DTTableViewDataSource? { get set }
  • Object, that is responsible for implementing UITableViewDragDelegate protocol

    Declaration

    Swift

    open var tableDragDelegate: DTTableViewDragDelegate? { get set }
  • Object, that is responsible for implementing UITableViewDropDelegate protocol

    Declaration

    Swift

    open var tableDropDelegate: DTTableViewDropDelegate? { get set }
  • Storage construction block, used by DTTableViewManager when it’s created. Returns MemoryStorage by default.

    Declaration

    Swift

    public static var defaultStorage: () -> Storage
  • Creates DTTableViewManager. Usually you don’t need to call this method directly, as manager property on DTTableViewManageable instance is filled automatically. DTTableViewManager.defaultStorage closure is used to determine which Storage would be used by default.

    Declaration

    Swift

    public init(storage: Storage = DTTableViewManager.defaultStorage())

    Parameters

    storage

    storage class to be used

  • Undocumented

    Declaration

    Swift

    open func configureDiffableDataSource<SectionIdentifier, ItemIdentifier>(modelProvider: @escaping (IndexPath, ItemIdentifier) -> Any)
        -> UITableViewDiffableDataSource<SectionIdentifier, ItemIdentifier>
  • Undocumented

    Declaration

    Swift

    open func configureDiffableDataSource(modelProvider: @escaping (IndexPath, Any) -> Any) -> UITableViewDiffableDataSourceReference
  • Starts managing UITableView.

    Call this method before calling any of DTTableViewManager methods.

    Precondition

    UITableView instance on delegate should not be nil.

    Note

    If delegate is DTViewModelMappingCustomizable, it will also be used to determine which view-model mapping should be used by table view factory.

    Declaration

    Swift

    open func startManaging(withDelegate delegate: DTTableViewManageable)
  • Returns closure, that updates cell at provided indexPath.

    This is used by coreDataUpdater method and can be used to silently update a cell without reload row animation.

    Declaration

    Swift

    open func updateCellClosure() -> (IndexPath, Any) -> Void
  • Updates visible cells, using tableView.indexPathsForVisibleRows, and update block. This may be more efficient than running reloadData, if number of your data models does not change, and the change you want to reflect is completely within models state.

    Declaration

    Swift

    open func updateVisibleCells(_ closure: ((UITableViewCell) -> Void)? = nil)

    Parameters

    closure

    closure to run for each cell after update has been completed.

  • Returns TableViewUpdater, configured to work with CoreDataStorage and NSFetchedResultsController updates.

    Precondition

    UITableView instance on delegate should not be nil.

    Declaration

    Swift

    open func coreDataUpdater() -> TableViewUpdater
  • Immediately runs closure to provide access to both T and T.ModelType for klass.

    • Discussion: This is particularly useful for registering events, because near 1/3 of events don’t have cell or view before they are getting run, which prevents view type from being known, and required developer to remember, which model is mapped to which cell. By using this container closure you will be able to provide compile-time safety for all events.

    Declaration

    Swift

    open func configureEvents<T>(for klass: T.Type, _ closure: (T.Type, T.ModelType.Type) -> Void) where T : ModelTransfer

    Parameters

    klass

    Class of reusable view to be used in configuration container

    closure

    closure to run with view types.

  • Registers closure to be executed, when UITableView requests cellClass in UITableViewDataSource.tableView(_:cellForRowAt:) method and cell is being configured.

    This closure will be performed after cell is created and update(with:) method is called.

    Declaration

    Swift

    open func configure<T>(_ cellClass: T.Type, _ closure: @escaping (T, T.ModelType, IndexPath) -> Void) where T : UITableViewCell, T : ModelTransfer
  • Registers closure to be executed, when UITableView requests headerClass in UITableViewDelegate.tableView(_:viewForHeaderInSection:) method and header is being configured.

    This closure will be performed after header is created and update(with:) method is called.

    Declaration

    Swift

    open func configureHeader<T>(_ headerClass: T.Type, _ closure: @escaping (T, T.ModelType, Int) -> Void) where T : UIView, T : ModelTransfer
  • Registers closure to be executed, when UITableView requests footerClass in UITableViewDelegate.tableView(_:viewForFooterInSection:) method and footer is being configured.

    This closure will be performed after footer is created and update(with:) method is called.

    Declaration

    Swift

    open func configureFooter<T>(_ footerClass: T.Type, _ closure: @escaping (T, T.ModelType, Int) -> Void) where T : UIView, T : ModelTransfer
  • Registers closure to be executed, when UITableViewDelegate.tableView(_:canMoveRowAt:) method is called for cellClass.

    Declaration

    Swift

    open func canMove<T>(_ cellClass: T.Type, _ closure: @escaping (T, T.ModelType, IndexPath) -> Bool) where T : UITableViewCell, T : ModelTransfer
  • Registers closure to be executed, when UITableViewDelegate.tableView(_:moveRowAt:to:) method is called for cellClass.

    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 move<T>(_ cellClass: T.Type, _ closure: @escaping (_ destinationIndexPath: IndexPath, T, T.ModelType, _ sourceIndexPath: IndexPath) -> Void) where T : UITableViewCell, T : ModelTransfer
  • Registers closure to be executed, when UITableViewDataSource.sectionIndexTitles(for:_) method is called.

    Declaration

    Swift

    open func sectionIndexTitles(_ closure: @escaping () -> [String]?)
  • Registers closure to be executed, when UITableViewDataSource.tableView(_:sectionForSectionIndexTitle:at:) method is called.

    Declaration

    Swift

    open func sectionForSectionIndexTitle(_ closure: @escaping (String, Int) -> Int)
  • Registers closure to be executed, when UITableViewDelegate.tableView(_:commitEditingStyle:forRowAt:) method is called for cellClass.

    Declaration

    Swift

    open func commitEditingStyle<T>(for cellClass: T.Type, _ closure: @escaping (UITableViewCell.EditingStyle, T, T.ModelType, IndexPath) -> Void) where T : UITableViewCell, T : ModelTransfer
  • Registers closure to be executed in UITableViewDelegate.tableView(_:canEditCellForRowAt:) method, when it’s called for cell which model is of itemType.

    Declaration

    Swift

    open func canEditCell<T>(withItem itemType: T.Type, _ closure: @escaping (T, IndexPath) -> Bool)
  • Registers closure to be executed, when UITableViewDelegate.tableView(_:didSelectRowAt:) method is called for cellClass.

    Declaration

    Swift

    open func didSelect<T>(_ cellClass: T.Type, _ closure: @escaping (T, T.ModelType, IndexPath) -> Void) where T : UITableViewCell, T : ModelTransfer
  • Registers closure to be executed, when UITableViewDelegate.tableView(_:willSelectRowAt:) method is called for cellClass.

    Declaration

    Swift

    open func willSelect<T>(_ cellClass: T.Type, _ closure: @escaping (T, T.ModelType, IndexPath) -> IndexPath?) where T : UITableViewCell, T : ModelTransfer
  • Registers closure to be executed, when UITableViewDelegate.tableView(_:willDeselectRowAt:) method is called for cellClass.

    Declaration

    Swift

    open func willDeselect<T>(_ cellClass: T.Type, _ closure: @escaping (T, T.ModelType, IndexPath) -> IndexPath?) where T : UITableViewCell, T : ModelTransfer
  • Registers closure to be executed, when UITableViewDelegate.tableView(_:didDeselectRowAt:) method is called for cellClass.

    Declaration

    Swift

    open func didDeselect<T>(_ cellClass: T.Type, _ closure: @escaping (T, T.ModelType, IndexPath) -> Void) where T : UITableViewCell, T : ModelTransfer
  • Registers closure to be executed to determine cell height in UITableViewDelegate.tableView(_:heightForRowAt:) method, when it’s called for cell which model is of itemType.

    Declaration

    Swift

    open func heightForCell<T>(withItem itemType: T.Type, _ closure: @escaping (T, IndexPath) -> CGFloat)
  • Registers closure to be executed to determine estimated cell height in UITableViewDelegate.tableView(_:estimatedHeightForRowAt:) method, when it’s called for cell which model is of itemType.

    Declaration

    Swift

    open func estimatedHeightForCell<T>(withItem itemType: T.Type, _ closure: @escaping (T, IndexPath) -> CGFloat)
  • Registers closure to be executed to determine indentation level in UITableViewDelegate.tableView(_:indentationLevelForRowAt:) method, when it’s called for cell which model is of itemType.

    Declaration

    Swift

    open func indentationLevelForCell<T>(withItem itemType: T.Type, _ closure: @escaping (T, IndexPath) -> CGFloat)
  • Registers closure to be executed, when UITableViewDelegate.tableView(_:willDisplayCell:forRowAt:) method is called for cellClass.

    Declaration

    Swift

    open func willDisplay<T>(_ cellClass: T.Type, _ closure: @escaping (T, T.ModelType, IndexPath) -> Void) where T : UITableViewCell, T : ModelTransfer
  • Registers closure to be executed, when UITableViewDelegate.tableView(_:accessoryButtonTappedForRowAt:) method is called for cellClass.

    Declaration

    Swift

    open func accessoryButtonTapped<T>(in cellClass: T.Type, _ closure: @escaping (T, T.ModelType, IndexPath) -> Void) where T : UITableViewCell, T : ModelTransfer
  • Registers closure to be executed to determine header height in UITableViewDelegate.tableView(_:heightForHeaderInSection:) method, when it’s called for header which model is of itemType.

    Declaration

    Swift

    open func heightForHeader<T>(withItem type: T.Type, _ closure: @escaping (T, Int) -> CGFloat)
  • Registers closure to be executed to determine estimated header height in UITableViewDelegate.tableView(_:estimatedHeightForHeaderInSection:) method, when it’s called for header which model is of itemType.

    Declaration

    Swift

    open func estimatedHeightForHeader<T>(withItem type: T.Type, _ closure: @escaping (T, Int) -> CGFloat)
  • Registers closure to be executed to determine footer height in UITableViewDelegate.tableView(_:heightForFooterInSection:) method, when it’s called for footer which model is of itemType.

    Declaration

    Swift

    open func heightForFooter<T>(withItem type: T.Type, _ closure: @escaping (T, Int) -> CGFloat)
  • Registers closure to be executed to determine estimated footer height in UITableViewDelegate.tableView(_:estimatedHeightForFooterInSection:) method, when it’s called for footer which model is of itemType.

    Declaration

    Swift

    open func estimatedHeightForFooter<T>(withItem type: T.Type, _ closure: @escaping (T, Int) -> CGFloat)
  • Registers closure to be executed, when UITableViewDelegate.tableView(_:willDisplayHeaderView:forSection:) method is called for headerClass.

    Declaration

    Swift

    open func willDisplayHeaderView<T>(_ headerClass: T.Type, _ closure: @escaping (T, T.ModelType, Int) -> Void) where T : UIView, T : ModelTransfer
  • Registers closure to be executed, when UITableViewDelegate.tableView(_:willDisplayFooterView:forSection:) method is called for footerClass.

    Declaration

    Swift

    open func willDisplayFooterView<T>(_ footerClass: T.Type, _ closure: @escaping (T, T.ModelType, Int) -> Void) where T : UIView, T : ModelTransfer
  • Undocumented

    Declaration

    Swift

    open func editActions<T>(for cellClass: T.Type, _ closure: @escaping (T, T.ModelType, IndexPath) -> [UITableViewRowAction]?) where T : UITableViewCell, T : ModelTransfer
  • Registers closure to be executed, when UITableViewDelegate.tableView(_:willBeginEditingRowAt:) method is called for cellClass.

    Declaration

    Swift

    open func willBeginEditing<T>(_ cellClass: T.Type, _ closure: @escaping (T, T.ModelType, IndexPath) -> Void) where T : UITableViewCell, T : ModelTransfer
  • Registers closure to be executed, when UITableViewDelegate.tableView(_:didEndEditingRowAt:) method is called for cellClass.

    Declaration

    Swift

    open func didEndEditing<T>(_ cellClass: T.Type, _ closure: @escaping (T, T.ModelType, IndexPath) -> Void) where T : UITableViewCell, T : ModelTransfer
  • Registers closure to be executed, when UITableViewDelegate.tableView(_:titleForDeleteConfirmationButtonForRowAt:) method is called for cellClass.

    Declaration

    Swift

    open func titleForDeleteConfirmationButton<T>(in cellClass: T.Type, _ closure: @escaping (T, T.ModelType, IndexPath) -> String?) where T : UITableViewCell, T : ModelTransfer
  • Registers closure to be executed, when UITableViewDelegate.tableView(_:editingStyleForRowAt:) method is called for cell that contains item ofType at indexPath.

    Declaration

    Swift

    open func editingStyle<T>(forItem ofType: T.Type, _ closure: @escaping (T, IndexPath) -> UITableViewCell.EditingStyle)
  • Registers closure to be executed, when UITableViewDelegate.tableView(_:shouldIndentWhileEditingRowAt:) method is called for cellClass.

    Declaration

    Swift

    open func shouldIndentWhileEditing<T>(_ cellClass: T.Type, _ closure: @escaping (T, T.ModelType, IndexPath) -> Bool) where T : UITableViewCell, T : ModelTransfer
  • Registers closure to be executed, when UITableViewDelegate.tableView(_:didEndDisplayingCell:forRowAt:) method is called for cellClass.

    Declaration

    Swift

    open func didEndDisplaying<T>(_ cellClass: T.Type, _ closure: @escaping (T, T.ModelType, IndexPath) -> Void) where T : UITableViewCell, T : ModelTransfer
  • Registers closure to be executed, when UITableViewDelegate.tableView(_:didEndDisplayingHeaderView:forSection:) method is called for headerClass.

    Declaration

    Swift

    open func didEndDisplayingHeaderView<T>(_ headerClass: T.Type, _ closure: @escaping (T, T.ModelType, Int) -> Void) where T : UIView, T : ModelTransfer
  • Registers closure to be executed, when UITableViewDelegate.tableView(_:didEndDisplayingFooterView:forSection:) method is called for footerClass.

    Declaration

    Swift

    open func didEndDisplayingFooterView<T>(_ footerClass: T.Type, _ closure: @escaping (T, T.ModelType, Int) -> Void) where T : UIView, T : ModelTransfer
  • Undocumented

    Declaration

    Swift

    open func shouldShowMenu<T>(for cellClass: T.Type, _ closure: @escaping (T, T.ModelType, IndexPath) -> Bool) where T : UITableViewCell, T : ModelTransfer
  • Undocumented

    Declaration

    Swift

    open func canPerformAction<T>(for cellClass: T.Type, _ closure: @escaping (Selector, Any?, T, T.ModelType, IndexPath) -> Bool) where T : UITableViewCell, T : ModelTransfer
  • Undocumented

    Declaration

    Swift

    open func performAction<T>(for cellClass: T.Type, _ closure: @escaping (Selector, Any?, T, T.ModelType, IndexPath) -> Void) where T : UITableViewCell, T : ModelTransfer
  • Registers closure to be executed, when UITableViewDelegate.tableView(_:shouldHighlightRowAt:) method is called for cellClass.

    Declaration

    Swift

    open func shouldHighlight<T>(_ cellClass: T.Type, _ closure: @escaping (T, T.ModelType, IndexPath) -> Bool) where T : UITableViewCell, T : ModelTransfer
  • Registers closure to be executed, when UITableViewDelegate.tableView(_:didHighlightRowAt:) method is called for cellClass.

    Declaration

    Swift

    open func didHighlight<T>(_ cellClass: T.Type, _ closure: @escaping (T, T.ModelType, IndexPath) -> Void) where T : UITableViewCell, T : ModelTransfer
  • Registers closure to be executed, when UITableViewDelegate.tableView(_:didUnhighlightRowAt:) method is called for cellClass.

    Declaration

    Swift

    open func didUnhighlight<T>(_ cellClass: T.Type, _ closure: @escaping (T, T.ModelType, IndexPath) -> Void) where T : UITableViewCell, T : ModelTransfer
  • Registers closure to be executed, when UITableViewDelegate.tableView(_:canFocusRowAt:) method is called for cellClass.

    Declaration

    Swift

    open func canFocus<T>(_ cellClass: T.Type, _ closure: @escaping (T, T.ModelType, IndexPath) -> Bool) where T : UITableViewCell, T : ModelTransfer
  • Registers closure to be executed when UITableViewDelegate.tableView(_:shouldUpdateFocusInContext:) method is called.

    Declaration

    Swift

    open func shouldUpdateFocus(_ closure: @escaping (UITableViewFocusUpdateContext) -> Bool)
  • Registers closure tp be executed when UITableViewDelegate.tableView(_:didUpdateFocusIn:with:) method is called.

    Declaration

    Swift

    open func didUpdateFocus(_ closure: @escaping (UITableViewFocusUpdateContext, UIFocusAnimationCoordinator) -> Void)
  • Registers closure to be executed when UITableViewDelegate.indexPathForPreferredFocusedView(in:) method is called

    Declaration

    Swift

    open func indexPathForPreferredFocusedView(_ closure: @escaping () -> IndexPath?)
  • Registers closure to be executed when UITableViewDelegate.targetIndexPathForMoveFromRowAt(_:toProposed:) method is called for cellClass

    Declaration

    Swift

    open func targetIndexPathForMove<T>(_ cellClass: T.Type, _ closure: @escaping (IndexPath, T, T.ModelType, IndexPath) -> IndexPath) where T : UITableViewCell, T : ModelTransfer
  • Registers closure to be executed when UITableViewDelegate.tableView(_:leadingSwipeActionsConfigurationForRowAt:) method is called for cellClass

    Declaration

    Swift

    open func leadingSwipeActionsConfiguration<T>(for cellClass: T.Type, _ closure: @escaping (T, T.ModelType, IndexPath) -> UISwipeActionsConfiguration?) where T : UITableViewCell, T : ModelTransfer
  • Registers closure to be executed when UITableViewDelegate.tableView(_:trailingSwipeActionsConfigurationForRowAt:) method is called for cellClass

    Declaration

    Swift

    open func trailingSwipeActionsConfiguration<T>(for cellClass: T.Type, _ closure: @escaping (T, T.ModelType, IndexPath) -> UISwipeActionsConfiguration?) where T : UITableViewCell, T : ModelTransfer
  • Registers closure to be executed when UITableViewDelegate.tableView(_:shouldSpringLoadRowAt:) method is called for cellClass.

    Declaration

    Swift

    open func shouldSpringLoad<T>(_ cellClass: T.Type, _ closure: @escaping (UISpringLoadedInteractionContext, T, T.ModelType, IndexPath) -> Bool) where T : UITableViewCell, T : ModelTransfer
  • Undocumented

    Declaration

    Swift

    open func shouldBeginMultipleSelectionInteraction<T:ModelTransfer>(for cellClass: T.Type,
                                                              _ closure: @escaping (T, T.ModelType, IndexPath) -> Bool)
        where T: UITableViewCell
  • Undocumented

    Declaration

    Swift

    open func didBeginMultipleSelectionInteraction<T:ModelTransfer>(for cellClass: T.Type,
                                                                    _ closure: @escaping (T, T.ModelType, IndexPath) -> Void)
        where T: UITableViewCell
  • Undocumented

    Declaration

    Swift

    open func didEndMultipleSelectionInteraction(_ closure: @escaping () -> Void)
  • Undocumented

    Declaration

    Swift

    open func contextMenuConfiguration<T:ModelTransfer>(for cellClass: T.Type,
                                                        _ closure: @escaping (CGPoint, T, T.ModelType, IndexPath) -> UIContextMenuConfiguration?)
        where T: UITableViewCell
  • Undocumented

    Declaration

    Swift

    open func previewForHighlightingContextMenu(_ closure: @escaping (UIContextMenuConfiguration) -> UITargetedPreview?)
  • Undocumented

    Declaration

    Swift

    open func previewForDismissingContextMenu(_ closure: @escaping (UIContextMenuConfiguration) -> UITargetedPreview?)
  • Registers closure to be executed when UITableViewDragDelegate.tableView(_:itemsForBeginning:at:) method is called for cellClass.

    Declaration

    Swift

    open func itemsForBeginningDragSession<T>(from cellClass: T.Type, _ closure: @escaping (UIDragSession, T, T.ModelType, IndexPath) -> [UIDragItem]) where T : UITableViewCell, T : ModelTransfer
  • Registers closure to be executed when UITableViewDragDelegate.tableView(_:itemsForAddingTo:at:point:) method is called for cellClass

    Declaration

    Swift

    open func itemsForAddingToDragSession<T>(from cellClass: T.Type, _ closure: @escaping (UIDragSession, CGPoint, T, T.ModelType, IndexPath) -> [UIDragItem]) where T : UITableViewCell, T : ModelTransfer
  • Registers closure to be executed when UITableViewDragDelegate.tableView(_:dragPreviewParametersForRowAt:) method is called for cellClass

    Declaration

    Swift

    open func dragPreviewParameters<T>(for cellClass: T.Type, _ closure: @escaping (T, T.ModelType, IndexPath) -> UIDragPreviewParameters?) where T : UITableViewCell, T : ModelTransfer
  • Registers closure to be executed when UITableViewDragDelegate.tableView(_:dragSessionWillBegin:) method is called.

    Declaration

    Swift

    open func dragSessionWillBegin(_ closure: @escaping (UIDragSession) -> Void)
  • Registers closure to be executed when UITableViewDragDelegate.tableView(_:dragSessionDidEnd:) method is called.

    Declaration

    Swift

    open func dragSessionDidEnd(_ closure: @escaping (UIDragSession) -> Void)
  • Registers closure to be executed when UITableViewDragDelegate.tableView(_:dragSessionAllowsMoveOperation) method is called.

    Declaration

    Swift

    open func dragSessionAllowsMoveOperation(_ closure: @escaping (UIDragSession) -> Bool)
  • Registers closure to be executed when UITableViewDragDelegate.tableView(_:dragSessionIsRestrictedToDraggingApplication:) method is called.

    Declaration

    Swift

    open func dragSessionIsRestrictedToDraggingApplication(_ closure: @escaping (UIDragSession) -> Bool)
  • Registers closure to be executed when UITableViewDropDelegate.tableView(_:performDropWith:) method is called.

    Declaration

    Swift

    open func performDropWithCoordinator(_ closure: @escaping (UITableViewDropCoordinator) -> Void)
  • Registers closure to be executed when UITableViewDropDelegate.tableView(_:canHandle:) method is called.

    Declaration

    Swift

    open func canHandleDropSession(_ closure: @escaping (UIDropSession) -> Bool)
  • Registers closure to be executed when UITableViewDropDelegate.tableView(_:dropSessionDidEnter:) method is called.

    Declaration

    Swift

    open func dropSessionDidEnter(_ closure: @escaping (UIDropSession) -> Void)
  • Registers closure to be executed when UITableViewDropDelegate.tableView(_:dropSessionDidUpdate:withDestination:) method is called.

    Declaration

    Swift

    open func dropSessionDidUpdate(_ closure: @escaping (UIDropSession, IndexPath?) -> UITableViewDropProposal)
  • Registers closure to be executed when UITableViewDropDelegate.tableView(_:dropSessionDidExit:) method is called.

    Declaration

    Swift

    open func dropSessionDidExit(_ closure: @escaping (UIDropSession) -> Void)
  • Registers closure to be executed when UITableViewDropDelegate.tableView(_:dropSessionDidEnd:) method is called.

    Declaration

    Swift

    open func dropSessionDidEnd(_ closure: @escaping (UIDropSession) -> Void)
  • Registers closure to be executed when UITableViewDropDelegate.tableView(_:dropPreviewParametersForRowAt:) method is called.

    Declaration

    Swift

    open func dropPreviewParameters(_ closure: @escaping (IndexPath) -> UIDragPreviewParameters?)
  • Convenience method for dropping item into placeholder. Returns DTTableViewDropPlaceholderContext, which is a replacement for UITableViewDropPlaceholderContext, that automatically handles drop if you are using MemoryStorage. It also automatically dispatches insertion to DispatchQueue.main.

    Declaration

    Swift

    open func drop(_ item: UIDragItem, to placeholder: UITableViewDropPlaceholder,
                   with coordinator: UITableViewDropCoordinator) -> DTTableViewDropPlaceholderContext
  • Registers mapping from model class to cellClass.

    Method will automatically check for nib with the same name as cellClass. If it exists - nib will be registered instead of class.

    Declaration

    Swift

    open func register<T>(_ cellClass: T.Type, mapping: ((ViewModelMapping) -> Void)? = nil) where T : UITableViewCell, T : ModelTransfer
  • Registers nib with nibName mapping from model class to cellClass.

    Declaration

    Swift

    open func registerNibNamed<T>(_ nibName: String, for cellClass: T.Type, mapping: ((ViewModelMapping) -> Void)? = nil) where T : UITableViewCell, T : ModelTransfer
  • Registers mapping from model class to header view of headerClass type.

    Method will automatically check for nib with the same name as headerClass. If it exists - nib will be registered instead of class. This method also sets TableViewConfiguration.sectionHeaderStyle property to .view.

    Note

    Views does not need to be UITableViewHeaderFooterView, if it’s a UIView subclass, it also will be created from XIB.

    See also

    UIView+XibLoading.

    Declaration

    Swift

    open func registerHeader<T>(_ headerClass: T.Type, mapping: ((ViewModelMapping) -> Void)? = nil) where T : UIView, T : ModelTransfer
  • Registers mapping from model class to header view of headerClass type.

    This method is intended to be used for headers created from code - without UI made in XIB. This method also sets TableViewConfiguration.sectionHeaderStyle property to .view.

    Declaration

    Swift

    open func registerNiblessHeader<T>(_ headerClass: T.Type, mapping: ((ViewModelMapping) -> Void)? = nil) where T : UITableViewHeaderFooterView, T : ModelTransfer
  • Registers mapping from model class to footer view of footerClass type.

    This method is intended to be used for footers created from code - without UI made in XIB. This method also sets TableViewConfiguration.sectionFooterStyle property to .view.

    Declaration

    Swift

    open func registerNiblessFooter<T>(_ footerClass: T.Type, mapping: ((ViewModelMapping) -> Void)? = nil) where T : UITableViewHeaderFooterView, T : ModelTransfer
  • Registers mapping from model class to footerView view of footerClass type.

    Method will automatically check for nib with the same name as footerClass. If it exists - nib will be registered instead of class. This method also sets TableViewConfiguration.sectionFooterStyle property to .view.

    Note

    Views does not need to be UITableViewHeaderFooterView, if it’s a UIView subclass, it also will be created from XIB.

    See also

    UIView+XibLoading.

    Declaration

    Swift

    open func registerFooter<T>(_ footerClass: T.Type, mapping: ((ViewModelMapping) -> Void)? = nil) where T : UIView, T : ModelTransfer
  • Registers mapping from model class to headerView view of headerClass type with nibName.

    This method also sets TableViewConfiguration.sectionHeaderStyle property to .view.

    Note

    Views does not need to be UITableViewHeaderFooterView, if it’s a UIView subclass, it also will be created from XIB.

    See also

    UIView+XibLoading.

    Declaration

    Swift

    open func registerNibNamed<T>(_ nibName: String, forHeader headerClass: T.Type, mapping: ((ViewModelMapping) -> Void)? = nil) where T : UIView, T : ModelTransfer
  • Registers mapping from model class to headerView view of footerClass type with nibName.

    This method also sets TableViewConfiguration.sectionFooterStyle property to .view.

    Note

    Views does not need to be UITableViewHeaderFooterView, if it’s a UIView subclass, it also will be created from XIB.

    See also

    UIView+XibLoading.

    Declaration

    Swift

    open func registerNibNamed<T>(_ nibName: String, forFooter footerClass: T.Type, mapping: ((ViewModelMapping) -> Void)? = nil) where T : UIView, T : ModelTransfer
  • Unregisters cellClass from DTTableViewManager and UITableView.

    Declaration

    Swift

    open func unregister<T>(_ cellClass: T.Type) where T : UITableViewCell, T : ModelTransfer
  • Unregisters headerClass from DTTableViewManager and UITableView.

    Declaration

    Swift

    open func unregisterHeader<T>(_ headerClass: T.Type) where T : UIView, T : ModelTransfer
  • Unregisters footerClass from DTTableViewManager and UITableView.

    Declaration

    Swift

    open func unregisterFooter<T>(_ footerClass: T.Type) where T : UIView, T : ModelTransfer