DTCollectionViewManager

open class DTCollectionViewManager

DTCollectionViewManager manages most of UICollectionView datasource and delegate methods and provides API for managing your data models in the collection view. Any method, that is not implemented by DTCollectionViewManager, will be forwarded to delegate.

See also

startManagingWithDelegate:
  • Bool property, that will be true, after startManagingWithDelegate method is called on DTCollectionViewManager.

    Declaration

    Swift

    open var isManagingCollectionView: 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 }
  • Anomaly handler, that handles reported by DTCollectionViewManager anomalies.

    Declaration

    Swift

    open var anomalyHandler: DTCollectionViewManagerAnomalyHandler
  • Storage, that holds your UICollectionView models. By default, it’s MemoryStorage instance.

    Note

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

    Note

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

    See also

    MemoryStorage, CoreDataStorage.

    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 UICollectionView, when received update from Storage

    Declaration

    Swift

    open var collectionViewUpdater: CollectionViewUpdater? { get set }
  • Object, that is responsible for implementing UICollectionViewDataSource protocol

    Declaration

    Swift

    open var collectionDataSource: DTCollectionViewDataSource? { get set }
  • Object, that is responsible for implementing UICollectionViewDelegate and UICollectionViewDelegateFlowLayout protocols

    Declaration

    Swift

    open var collectionDelegate: DTCollectionViewDelegate? { get set }
  • Object, that is responsible for implementing UICollectionViewDragDelegate protocol

  • Object, that is responsible for implementing UICOllectionViewDropDelegate protocol

  • Storage construction block, used by DTCollectionViewManager when it’s created. Returns MemoryStorage by default.

    Declaration

    Swift

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

    Declaration

    Swift

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

    Parameters

    storage

    storage class to be used

  • Call this method before calling any of DTCollectionViewManager methods.

    Precondition

    UICollectionView instance on delegate should not be nil.

    Declaration

    Swift

    open func startManaging(withDelegate delegate: DTCollectionViewManageable)

    Parameters

    delegate

    Object, that has UICollectionView, that will be managed by DTCollectionViewManager.

  • Undocumented

    Declaration

    Swift

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

    Declaration

    Swift

    open func configureDiffableDataSource(modelProvider: @escaping (IndexPath, Any) -> Any) -> UICollectionViewDiffableDataSourceReference
  • Returns closure, that updates cell at provided indexPath.

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

    Declaration

    Swift

    open func updateCellClosure() -> (IndexPath, Any) -> Void
  • Updates visible cells, using collectionView.indexPathsForVisibleItems, 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: ((UICollectionViewCell) -> Void)? = nil)

    Parameters

    closure

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

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

    Precondition

    UICollectionView instance on delegate should not be nil.

    Declaration

    Swift

    open func coreDataUpdater() -> CollectionViewUpdater
  • 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 UICollectionView requests cellClass in UICollectionViewDataSource.collectionView(_:cellForItemAt:) 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 : UICollectionViewCell, T : ModelTransfer
  • Registers closure to be executed, when UICollectionView requests headerClass in UICollectionViewDataSource.collectionView(_:viewForSupplementaryElementOf:at:) 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 : UICollectionReusableView, T : ModelTransfer
  • Registers closure to be executed, when UICollectionView requests footerClass in UICollectionViewDataSource.collectionView(_:viewForSupplementaryElementOf:at:) 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 : UICollectionReusableView, T : ModelTransfer
  • Registers closure to be executed, when UICollectionView requests supplementaryClass of kind in UICollectionViewDataSource.collectionView(_:viewForSupplementaryElementOf:at:) method and supplementary view is being configured.

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

    Declaration

    Swift

    open func configureSupplementary<T>(_ supplementaryClass: T.Type, ofKind kind: String, _ closure: @escaping (T, T.ModelType, IndexPath) -> Void) where T : UICollectionReusableView, T : ModelTransfer
  • Registers closure to be executed, when UICollectionViewDataSource.collectionView(_:canMoveItemAt:) method is called for cellClass.

    Declaration

    Swift

    open func canMove<T>(_ cellClass: T.Type, _ closure: @escaping (T, T.ModelType, IndexPath) -> Bool) where T : UICollectionViewCell, T : ModelTransfer
  • Registers closure to be executed, when UICollectionViewDataSrouce.(_:moveItemAt: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

    ‘collectionView:moveRowAt:to:’ method

    Declaration

    Swift

    open func moveItemAtTo(_ closure: @escaping (_ sourceIndexPath: IndexPath, _ destinationIndexPath: IndexPath) -> Void)
  • Undocumented

    Declaration

    Swift

    func move<T>(_ cellClass: T.Type, _ closure: @escaping (_ destinationIndexPath: IndexPath, T, T.ModelType, _ sourceIndexPath: IndexPath) -> Void) where T : UICollectionViewCell, T : ModelTransfer
  • Registers closure to be executed, when UICollectionViewDataSource.indexTitlesForCollectionView(_:) method is called.

    Declaration

    Swift

    open func indexTitles(_ closure: @escaping () -> [String]?)
  • Registers closure to be executed when UICollectionViewDataSource.collectionView(_:indexPathForIndexTitle:) method is called.

    Declaration

    Swift

    open func indexPathForIndexTitle(_ closure: @escaping (String, Int) -> IndexPath)
  • Registers closure to be executed, when UICollectionViewDelegate.collectionView(_:didSelectItemAt:) method is called for cellClass.

    Declaration

    Swift

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

    Declaration

    Swift

    open func shouldSelect<T>(_ cellClass: T.Type, _ closure: @escaping (T, T.ModelType, IndexPath) -> Bool) where T : UICollectionViewCell, T : ModelTransfer
  • Registers closure to be executed, when UICollectionViewDelegate.collectionView(_:shouldDeselectItemAt:) method is called for cellClass.

    Declaration

    Swift

    open func shouldDeselect<T>(_ cellClass: T.Type, _ closure: @escaping (T, T.ModelType, IndexPath) -> Bool) where T : UICollectionViewCell, T : ModelTransfer
  • Registers closure to be executed, when UICollectionViewDelegate.collectionView(_:didDeselectItemAt:) method is called for cellClass.

    Declaration

    Swift

    open func didDeselect<T>(_ cellClass: T.Type, _ closure: @escaping (T, T.ModelType, IndexPath) -> Void) where T : UICollectionViewCell, T : ModelTransfer
  • Registers closure to be executed, when UICollectionViewDelegate.collectionView(_:shouldHighlightItemAt:) method is called for cellClass.

    Declaration

    Swift

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

    Declaration

    Swift

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

    Declaration

    Swift

    open func didUnhighlight<T>(_ cellClass: T.Type, _ closure: @escaping (T, T.ModelType, IndexPath) -> Void) where T : UICollectionViewCell, T : ModelTransfer
  • Registers closure to be executed, when UICollectionViewDelegate.collectionView(_:willDisplayCell:forItemAt:) method is called for cellClass.

    Declaration

    Swift

    open func willDisplay<T>(_ cellClass: T.Type, _ closure: @escaping (T, T.ModelType, IndexPath) -> Void) where T : UICollectionViewCell, T : ModelTransfer
  • Registers closure to be executed, when UICollectionViewDelegate.collectionView(_:willDisplaySupplementaryView:forElementKind:at:) method is called for supplementaryClass of kind.

    Declaration

    Swift

    open func willDisplaySupplementaryView<T>(_ supplementaryClass: T.Type, forElementKind kind: String, _ closure: @escaping (T, T.ModelType, IndexPath) -> Void) where T : UICollectionReusableView, T : ModelTransfer
  • Registers closure to be executed, when UICollectionViewDelegate.collectionView(_:willDisplaySupplementaryView:forElementKind:at:) method is called for supplementaryClass of UICollectionElementKindSectionHeader.

    Declaration

    Swift

    open func willDisplayHeaderView<T>(_ headerClass: T.Type, _ closure: @escaping (T, T.ModelType, IndexPath) -> Void) where T : UICollectionReusableView, T : ModelTransfer
  • Registers closure to be executed, when UICollectionViewDelegate.collectionView(_:willDisplaySupplementaryView:forElementKind:at:) method is called for supplementaryClass of UICollectionElementKindSectionFooter.

    Declaration

    Swift

    open func willDisplayFooterView<T>(_ footerClass: T.Type, _ closure: @escaping (T, T.ModelType, IndexPath) -> Void) where T : UICollectionReusableView, T : ModelTransfer
  • Registers closure to be executed, when UICollectionViewDelegate.collectionView(_:didEndDisplaying:forItemAt:) method is called for cellClass.

    Declaration

    Swift

    open func didEndDisplaying<T>(_ cellClass: T.Type, _ closure: @escaping (T, T.ModelType, IndexPath) -> Void) where T : UICollectionViewCell, T : ModelTransfer
  • Registers closure to be executed, when UICollectionViewDelegate.collectionView(_:didEndDisplayingSupplementaryView:forElementKind:at:) method is called for supplementaryClass of kind.

    Declaration

    Swift

    open func didEndDisplayingSupplementaryView<T>(_ supplementaryClass: T.Type, forElementKind kind: String, _ closure: @escaping (T, T.ModelType, IndexPath) -> Void) where T : UICollectionReusableView, T : ModelTransfer
  • Registers closure to be executed, when UICollectionViewDelegate.collectionView(_:didEndDisplayingSupplementaryView:forElementKind:at:) method is called for headerClass of UICollectionElementKindSectionHeader.

    Declaration

    Swift

    open func didEndDisplayingHeaderView<T>(_ headerClass: T.Type, _ closure: @escaping (T, T.ModelType, IndexPath) -> Void) where T : UICollectionReusableView, T : ModelTransfer
  • Registers closure to be executed, when UICollectionViewDelegate.collectionView(_:didEndDisplayingSupplementaryView:forElementKind:at:) method is called for footerClass of UICollectionElementKindSectionFooter.

    Declaration

    Swift

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

    Declaration

    Swift

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

    Declaration

    Swift

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

    Declaration

    Swift

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

    Declaration

    Swift

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

    Declaration

    Swift

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

    Declaration

    Swift

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

    Declaration

    Swift

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

    Declaration

    Swift

    open func targetIndexPathForMovingItem<T>(_ cellClass: T.Type, _ closure: @escaping (IndexPath, T, T.ModelType, IndexPath) -> IndexPath) where T : UICollectionViewCell, T : ModelTransfer
  • Registers closure to be executed when UICollectionViewDelegate.collectionView(_:targetContentOffsetForProposedContentOffset:) method is called.

    Declaration

    Swift

    open func targetContentOffsetForProposedContentOffset(_ closure: @escaping (CGPoint) -> CGPoint)
  • Registers closure to be executed when UICollectionViewDelegate.collectionView(_:shouldSpringLoadItemAt:) method is called for cellClass.

UICollectionViewDelegateFlowLayout

  • Registers closure to be executed to determine cell size in UICollectionViewDelegateFlowLayout.collectionView(_:sizeForItemAt:) method, when it’s called for cell which model is of itemType.

    Declaration

    Swift

    open func sizeForCell<T>(withItem: T.Type, _ closure: @escaping (T, IndexPath) -> CGSize)
  • Registers closure to be executed to determine header size in UICollectionViewDelegateFlowLayout.collectionView(_:layout:referenceSizeForHeaderViewInSection:) method, when it’s called for header which model is of itemType.

    Declaration

    Swift

    open func referenceSizeForHeaderView<T>(withItem: T.Type, _ closure: @escaping (T, IndexPath) -> CGSize)
  • Registers closure to be executed to determine footer size in UICollectionViewDelegateFlowLayout.collectionView(_:layout:referenceSizeForFooterViewInSection:) method, when it’s called for footer which model is of itemType.

    Declaration

    Swift

    open func referenceSizeForFooterView<T>(withItem: T.Type, _ closure: @escaping (T, IndexPath) -> CGSize)
  • Registers closure to be executed when UICollectionViewDelegate.collectionView(_:transitionLayoutForOldLayout:toNewLayout:) method is called

    Declaration

    Swift

    open func transitionLayout(_ closure: @escaping (_ oldLayout: UICollectionViewLayout, _ newLayout: UICollectionViewLayout) -> UICollectionViewTransitionLayout)
  • Registers closure to be executed when UICollectionViewDelegateFlowLayout.collectionView(_:layout:insetForSectionAt:) method is called.

    Declaration

    Swift

    open func insetForSectionAtIndex(_ closure: @escaping (UICollectionViewLayout, Int) -> UIEdgeInsets)
  • Registers closure to be executed when UICollectionViewDelegateFlowLayout.collectionView(_:layout:minimumLineSpacingForSectionAt:) method is called.

    Declaration

    Swift

    open func minimumLineSpacingForSectionAtIndex(_ closure: @escaping (UICollectionViewLayout, Int) -> CGFloat)
  • Registers closure to be executed when UICollectionViewDelegateFlowLayout.collectionView(_:layout:insetForSectionAt:) method is called.

    Declaration

    Swift

    open func minimumInteritemSpacingForSectionAtIndex(_ closure: @escaping (UICollectionViewLayout, Int) -> CGFloat)
  • Registers closure to be executed when UICollectionViewDragDelegate.collectionView(_:itemsForBeginning:at:) method is called for cellClass.

  • Registers closure to be executed when UICollectionViewDragDelegate.collectionView(_:itemsForAddingTo:at:point:) method is called for cellClass

  • Registers closure to be executed when UICollectionViewDragDelegate.collectionView(_:dragPreviewParametersForRowAt:) method is called for cellClass

  • Registers closure to be executed when UICollectionViewDragDelegate.collectionView(_:dragSessionWillBegin:) method is called.

  • Registers closure to be executed when UICollectionViewDragDelegate.collectionView(_:dragSessionDidEnd:) method is called.

  • Registers closure to be executed when UICollectionViewDragDelegate.collectionView(_:dragSessionAllowsMoveOperation) method is called.

  • Registers closure to be executed when UICollectionViewDragDelegate.collectionView(_:dragSessionIsRestrictedToDraggingApplication:) method is called.

  • Registers closure to be executed when UICollectionViewDropDelegate.collectionView(_:performDropWith:) method is called.

  • Registers closure to be executed when UICollectionViewDropDelegate.collectionView(_:canHandle:) method is called.

  • Registers closure to be executed when UICollectionViewDropDelegate.collectionView(_:dropSessionDidEnter:) method is called.

  • Registers closure to be executed when UICollectionViewDropDelegate.collectionView(_:dropSessionDidUpdate:withDestination:) method is called.

  • Registers closure to be executed when UICollectionViewDropDelegate.collectionView(_:dropSessionDidExit:) method is called.

  • Registers closure to be executed when UICollectionViewDropDelegate.collectionView(_:dropSessionDidEnd:) method is called.

  • Registers closure to be executed when UICollectionViewDropDelegate.collectionView(_:dropPreviewParametersForRowAt:) method is called.

  • Convenience method for dropping item into placeholder. Returns DTCollectionViewDropPlaceholderContext, which is a replacement for UICollectionViewDropPlaceholderContext, that automatically handles drop if you are using MemoryStorage. It also automatically dispatches insertion to DispatchQueue.main.

  • 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. If not - it is assumed that cell is registered in storyboard.

    Note

    If you need to create cell interface from code, use registerNibless(_:) method

    Declaration

    Swift

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

    Declaration

    Swift

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

    Declaration

    Swift

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

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

    Declaration

    Swift

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

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

    Declaration

    Swift

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

    Declaration

    Swift

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

    Declaration

    Swift

    open func registerNibNamed<T>(_ nibName: String, forFooter footerClass: T.Type, mappingBlock: ((ViewModelMapping) -> Void)? = nil) where T : UICollectionReusableView, T : ModelTransfer
  • Registers mapping from model class to suppplementary view of supplementaryClass type for supplementary kind.

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

    Declaration

    Swift

    open func registerSupplementary<T>(_ supplementaryClass: T.Type, forKind kind: String, mappingBlock: ((ViewModelMapping) -> Void)? = nil) where T : UICollectionReusableView, T : ModelTransfer
  • Registers mapping from model class to supplementary view of supplementaryClass type with nibName for supplementary kind.

    Declaration

    Swift

    open func registerNibNamed<T>(_ nibName: String, forSupplementary supplementaryClass: T.Type, ofKind kind: String, mappingBlock: ((ViewModelMapping) -> Void)? = nil) where T : UICollectionReusableView, T : ModelTransfer
  • Registers mapping from model class to supplementary view of supplementaryClass type for supplementary kind.

    Declaration

    Swift

    open func registerNiblessSupplementary<T>(_ supplementaryClass: T.Type, forKind kind: String, mappingBlock: ((ViewModelMapping) -> Void)? = nil) where T : UICollectionReusableView, T : ModelTransfer
  • Registers mapping from model class to header view of headerClass type for UICollectionElementKindSectionHeader.

    Declaration

    Swift

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

    Declaration

    Swift

    open func registerNiblessFooter<T>(_ footerClass: T.Type, mappingBlock: ((ViewModelMapping) -> Void)? = nil) where T : UICollectionReusableView, T : ModelTransfer
  • Unregisters cellClass from DTCollectionViewManager and UICollectionView.

    Declaration

    Swift

    open func unregister<T>(_ cellClass: T.Type) where T : UICollectionViewCell, T : ModelTransfer
  • Unregisters headerClass from DTCollectionViewManager and UICollectionView.

    Declaration

    Swift

    open func unregisterHeader<T>(_ headerClass: T.Type) where T : UICollectionReusableView, T : ModelTransfer
  • Unregisters footerClass from DTCollectionViewManager and UICollectionView.

    Declaration

    Swift

    open func unregisterFooter<T>(_ headerClass: T.Type) where T : UICollectionReusableView, T : ModelTransfer
  • Unregisters supplementaryClass of kind from DTCollectionViewManager and UICollectionView.

    Declaration

    Swift

    open func unregisterSupplementary<T>(_ supplementaryClass: T.Type, forKind kind: String) where T : UICollectionReusableView, T : ModelTransfer