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
withcontext
andstorage
Declaration
Swift
public init(context: UICollectionViewDropPlaceholderContext, storage: Storage)
-
Commits insertion of item, using
UICollectionViewDropPlaceholderContext.commitInsertion(_:)
method. Both commit andinsertionIndexPathClosure
will be automatically dispatched toDispatchQueue.main
. If you are usingMemoryStorage
, 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