DTCollectionViewDropPlaceholderContext

open class DTCollectionViewDropPlaceholderContext

Thin wrapper around UICollectionViewDropPlaceholderContext, which automates insertion of dragItems if you are using MemoryStorage. Typically, you would not create this class directly, but use DTCollectionViewManager.drop(_:to:with:) convenience method.

  • Drop context

    Declaration

    Swift

    public let context: UICollectionViewDropPlaceholderContext
  • Creates DTCollectionViewDropPlaceholderContext with context and storage

    Declaration

    Swift

    public init(context: UICollectionViewDropPlaceholderContext, storage: Storage)
  • Commits insertion of item, using UICollectionViewDropPlaceholderContext.commitInsertion(_:) method. Both commit and insertionIndexPathClosure will be automatically dispatched to DispatchQueue.main. If you are using MemoryStorage, model will be automatically inserted, and no additional actions are required.

    Declaration

    Swift

    open func commitInsertion<T>(ofItem item: T, _ insertionIndexPathClosure: ((IndexPath) -> Void)? = nil)
  • Undocumented

    Declaration

    Swift

    @discardableResult
    open func deletePlaceholder() -> Bool