DTTableViewDropPlaceholderContext

open class DTTableViewDropPlaceholderContext

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

  • Drop context

    Declaration

    Swift

    public let context: UITableViewDropPlaceholderContext
  • Creates DTTableViewDropPlaceholderContext with context and storage

    Declaration

    Swift

    public init(context: UITableViewDropPlaceholderContext, storage: Storage?)
  • Commits insertion of item, using UITableViewDropPlaceholderContext.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