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 onDTCollectionViewManager
.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 toDTCollectionViewManager
instance.Note
Previous storagedelegate
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 fromStorage
Declaration
Swift
open var collectionViewUpdater: CollectionViewUpdater? { get set }
-
Object, that is responsible for implementing
UICollectionViewDataSource
protocolDeclaration
Swift
open var collectionDataSource: DTCollectionViewDataSource? { get set }
-
Object, that is responsible for implementing
UICollectionViewDelegate
andUICollectionViewDelegateFlowLayout
protocolsDeclaration
Swift
open var collectionDelegate: DTCollectionViewDelegate? { get set }
-
Undocumented
Declaration
Swift
open var collectionDragDelegate: DTCollectionViewDragDelegate? { get set }
-
Undocumented
Declaration
Swift
open var collectionDropDelegate: DTCollectionViewDropDelegate? { get set }
-
Storage construction block, used by
DTCollectionViewManager
when it’s created. ReturnsMemoryStorage
by default.Declaration
Swift
public static var defaultStorage: () -> Storage
-
Creates
DTCollectionViewManager
. Usually you don’t need to call this method directly, asmanager
property onDTCollectionViewManageable
instance is filled automatically.DTCollectionViewManager.defaultStorage
closure is used to determine whichStorage
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 ondelegate
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 runningreloadData
, 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 withCoreDataStorage
andNSFetchedResultsController
updates.Precondition
UICollectionView instance ondelegate
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, whenUICollectionView
requestscellClass
inUICollectionViewDataSource.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, whenUICollectionView
requestsheaderClass
inUICollectionViewDataSource.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, whenUICollectionView
requestsfooterClass
inUICollectionViewDataSource.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, whenUICollectionView
requestssupplementaryClass
ofkind
inUICollectionViewDataSource.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
-
Undocumented
Declaration
Swift
open func canMove<T>(_ cellClass: T.Type, _ closure: @escaping (T, T.ModelType, IndexPath) -> Bool) where T : UICollectionViewCell, T : ModelTransfer
-
Undocumented
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
-
Undocumented
Declaration
Swift
open func indexTitles(_ closure: @escaping () -> [String]?)
-
Undocumented
Declaration
Swift
open func indexPathForIndexTitle(_ closure: @escaping (String, Int) -> IndexPath)
-
Registers
closure
to be executed, whenUICollectionViewDelegate.collectionView(_:didSelectItemAt:)
method is called forcellClass
.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, whenUICollectionViewDelegate.collectionView(_:shouldSelectItemAt:)
method is called forcellClass
.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, whenUICollectionViewDelegate.collectionView(_:shouldDeselectItemAt:)
method is called forcellClass
.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, whenUICollectionViewDelegate.collectionView(_:didDeselectItemAt:)
method is called forcellClass
.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, whenUICollectionViewDelegate.collectionView(_:shouldHighlightItemAt:)
method is called forcellClass
.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, whenUICollectionViewDelegate.collectionView(_:didHighlightItemAt:)
method is called forcellClass
.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, whenUICollectionViewDelegate.collectionView(_:didUnhighlightItemAt:)
method is called forcellClass
.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, whenUICollectionViewDelegate.collectionView(_:willDisplayCell:forItemAt:)
method is called forcellClass
.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, whenUICollectionViewDelegate.collectionView(_:willDisplaySupplementaryView:forElementKind:at:)
method is called forsupplementaryClass
ofkind
.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, whenUICollectionViewDelegate.collectionView(_:willDisplaySupplementaryView:forElementKind:at:)
method is called forsupplementaryClass
ofUICollectionElementKindSectionHeader
.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, whenUICollectionViewDelegate.collectionView(_:willDisplaySupplementaryView:forElementKind:at:)
method is called forsupplementaryClass
ofUICollectionElementKindSectionFooter
.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, whenUICollectionViewDelegate.collectionView(_:didEndDisplaying:forItemAt:)
method is called forcellClass
.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, whenUICollectionViewDelegate.collectionView(_:didEndDisplayingSupplementaryView:forElementKind:at:)
method is called forsupplementaryClass
ofkind
.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, whenUICollectionViewDelegate.collectionView(_:didEndDisplayingSupplementaryView:forElementKind:at:)
method is called forheaderClass
ofUICollectionElementKindSectionHeader
.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, whenUICollectionViewDelegate.collectionView(_:didEndDisplayingSupplementaryView:forElementKind:at:)
method is called forfooterClass
ofUICollectionElementKindSectionFooter
.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
-
Undocumented
Declaration
Swift
open func canFocus<T>(_ cellClass: T.Type, _ closure: @escaping (T, T.ModelType, IndexPath) -> Bool) where T : UICollectionViewCell, T : ModelTransfer
-
Undocumented
Declaration
Swift
open func shouldUpdateFocus(_ closure: @escaping (UICollectionViewFocusUpdateContext) -> Bool)
-
Undocumented
Declaration
Swift
open func didUpdateFocus(_ closure: @escaping (UICollectionViewFocusUpdateContext, UIFocusAnimationCoordinator) -> Void)
-
Undocumented
Declaration
Swift
open func indexPathForPreferredFocusedView(_ closure: @escaping () -> IndexPath?)
-
Undocumented
Declaration
Swift
open func targetIndexPathForMovingItem<T>(_ cellClass: T.Type, _ closure: @escaping (IndexPath, T, T.ModelType, IndexPath) -> IndexPath) where T : UICollectionViewCell, T : ModelTransfer
-
Undocumented
Declaration
Swift
open func targetContentOffsetForProposedContentOffset(_ closure: @escaping (CGPoint) -> CGPoint)
-
Undocumented
Declaration
Swift
open func shouldSpringLoad<T:ModelTransfer>(_ cellClass: T.Type, _ closure: @escaping (UISpringLoadedInteractionContext, T, T.ModelType, IndexPath) -> Bool) where T: UICollectionViewCell
-
Undocumented
Declaration
Swift
open func shouldBeginMultipleSelectionInteraction<T:ModelTransfer>(for cellClass: T.Type, _ closure: @escaping (T, T.ModelType, IndexPath) -> Bool) where T: UICollectionViewCell
-
Undocumented
Declaration
Swift
open func didBeginMultipleSelectionInteraction<T:ModelTransfer>(for cellClass: T.Type, _ closure: @escaping (T, T.ModelType, IndexPath) -> Void) where T: UICollectionViewCell
-
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: UICollectionViewCell
-
Undocumented
Declaration
Swift
open func previewForHighlightingContextMenu(_ closure: @escaping (UIContextMenuConfiguration) -> UITargetedPreview?)
-
Undocumented
Declaration
Swift
open func previewForDismissingContextMenu(_ closure: @escaping (UIContextMenuConfiguration) -> UITargetedPreview?)
-
Undocumented
Declaration
Swift
open func willCommitMenuWithAnimator(_ closure: @escaping (UIContextMenuInteractionCommitAnimating) -> Void)
-
Registers
closure
to be executed to determine cell size inUICollectionViewDelegateFlowLayout.collectionView(_:sizeForItemAt:)
method, when it’s called for cell which model is ofitemType
.Declaration
Swift
open func sizeForCell<T>(withItem: T.Type, _ closure: @escaping (T, IndexPath) -> CGSize)
-
Registers
closure
to be executed to determine header size inUICollectionViewDelegateFlowLayout.collectionView(_:layout:referenceSizeForHeaderViewInSection:)
method, when it’s called for header which model is ofitemType
.Declaration
Swift
open func referenceSizeForHeaderView<T>(withItem: T.Type, _ closure: @escaping (T, IndexPath) -> CGSize)
-
Registers
closure
to be executed to determine footer size inUICollectionViewDelegateFlowLayout.collectionView(_:layout:referenceSizeForFooterViewInSection:)
method, when it’s called for footer which model is ofitemType
.Declaration
Swift
open func referenceSizeForFooterView<T>(withItem: T.Type, _ closure: @escaping (T, IndexPath) -> CGSize)
-
Registers
closure
to be executed whenUICollectionViewDelegate.collectionView(_:transitionLayoutForOldLayout:toNewLayout:
) method is calledDeclaration
Swift
open func transitionLayout(_ closure: @escaping (_ oldLayout: UICollectionViewLayout, _ newLayout: UICollectionViewLayout) -> UICollectionViewTransitionLayout)
-
Registers
closure
to be executed whenUICollectionViewDelegateFlowLayout.collectionView(_:layout:insetForSectionAt:)
method is called.Declaration
Swift
open func insetForSectionAtIndex(_ closure: @escaping (UICollectionViewLayout, Int) -> UIEdgeInsets)
-
Registers
closure
to be executed whenUICollectionViewDelegateFlowLayout.collectionView(_:layout:minimumLineSpacingForSectionAt:)
method is called.Declaration
Swift
open func minimumLineSpacingForSectionAtIndex(_ closure: @escaping (UICollectionViewLayout, Int) -> CGFloat)
-
Registers
closure
to be executed whenUICollectionViewDelegateFlowLayout.collectionView(_:layout:insetForSectionAt:)
method is called.Declaration
Swift
open func minimumInteritemSpacingForSectionAtIndex(_ closure: @escaping (UICollectionViewLayout, Int) -> CGFloat)
-
Undocumented
Declaration
Swift
open func itemsForBeginningDragSession<T>(from cellClass: T.Type, _ closure: @escaping (UIDragSession, T, T.ModelType, IndexPath) -> [UIDragItem]) where T : UICollectionViewCell, T : ModelTransfer
-
Undocumented
Declaration
Swift
open func itemsForAddingToDragSession<T>(from cellClass: T.Type, _ closure: @escaping (UIDragSession, CGPoint, T, T.ModelType, IndexPath) -> [UIDragItem]) where T : UICollectionViewCell, T : ModelTransfer
-
Undocumented
Declaration
Swift
open func dragPreviewParameters<T>(for cellClass: T.Type, _ closure: @escaping (T, T.ModelType, IndexPath) -> UIDragPreviewParameters?) where T : UICollectionViewCell, T : ModelTransfer
-
Undocumented
Declaration
Swift
open func dragSessionWillBegin(_ closure: @escaping (UIDragSession) -> Void)
-
Undocumented
Declaration
Swift
open func dragSessionDidEnd(_ closure: @escaping (UIDragSession) -> Void)
-
Undocumented
Declaration
Swift
open func dragSessionAllowsMoveOperation(_ closure: @escaping (UIDragSession) -> Bool)
-
Undocumented
Declaration
Swift
open func dragSessionIsRestrictedToDraggingApplication(_ closure: @escaping (UIDragSession) -> Bool)
-
Undocumented
Declaration
Swift
open func performDropWithCoordinator(_ closure: @escaping (UICollectionViewDropCoordinator) -> Void)
-
Undocumented
Declaration
Swift
open func canHandleDropSession(_ closure: @escaping (UIDropSession) -> Bool)
-
Undocumented
Declaration
Swift
open func dropSessionDidEnter(_ closure: @escaping (UIDropSession) -> Void)
-
Undocumented
Declaration
Swift
open func dropSessionDidUpdate(_ closure: @escaping (UIDropSession, IndexPath?) -> UICollectionViewDropProposal)
-
Undocumented
Declaration
Swift
open func dropSessionDidExit(_ closure: @escaping (UIDropSession) -> Void)
-
Undocumented
Declaration
Swift
open func dropSessionDidEnd(_ closure: @escaping (UIDropSession) -> Void)
-
Undocumented
Declaration
Swift
open func dropPreviewParameters(_ closure: @escaping (IndexPath) -> UIDragPreviewParameters?)
-
Undocumented
Declaration
Swift
open func drop(_ item: UIDragItem, to placeholder: UICollectionViewDropPlaceholder, with coordinator: UICollectionViewDropCoordinator) -> DTCollectionViewDropPlaceholderContext
-
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, useregisterNibless(_:)
methodDeclaration
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 tocellClass
.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 withnibName
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 withnibName
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 supplementarykind
.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 withnibName
for supplementarykind
.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 supplementarykind
.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 forUICollectionElementKindSectionHeader
.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 forUICollectionElementKindSectionFooter
.Declaration
Swift
open func registerNiblessFooter<T>(_ footerClass: T.Type, mappingBlock: ((ViewModelMapping) -> Void)? = nil) where T : UICollectionReusableView, T : ModelTransfer
-
Unregisters
cellClass
fromDTCollectionViewManager
andUICollectionView
.Declaration
Swift
open func unregister<T>(_ cellClass: T.Type) where T : UICollectionViewCell, T : ModelTransfer
-
Unregisters
headerClass
fromDTCollectionViewManager
andUICollectionView
.Declaration
Swift
open func unregisterHeader<T>(_ headerClass: T.Type) where T : UICollectionReusableView, T : ModelTransfer
-
Unregisters
footerClass
fromDTCollectionViewManager
andUICollectionView
.Declaration
Swift
open func unregisterFooter<T>(_ headerClass: T.Type) where T : UICollectionReusableView, T : ModelTransfer
-
Unregisters
supplementaryClass
ofkind
fromDTCollectionViewManager
andUICollectionView
.Declaration
Swift
open func unregisterSupplementary<T>(_ supplementaryClass: T.Type, forKind kind: String) where T : UICollectionReusableView, T : ModelTransfer