@@ -802,8 +802,7 @@ public class OutlineViewDiffableDataSource<ItemIdentifierType: Hashable>: NSObje
802
802
return reorderingHandlers. canReorder ? ( draggedItems, item as? ItemIdentifierType ) ?? true == true ? . move : [ ]
803
803
} else if let canDrop = droppingHandlers. canDrop {
804
804
dropItems = [ ]
805
- dropContent = info. draggingPasteboard. content
806
- if canDrop ( dropContent, item as? ItemIdentifierType ) , let items = droppingHandlers. items ? ( dropContent, item as? ItemIdentifierType ) , !items. isEmpty {
805
+ if canDrop ( info. dropInfo ( for: outlineView) , item as? ItemIdentifierType ) , let items = droppingHandlers. items ? ( info. dropInfo ( for: outlineView) , item as? ItemIdentifierType ) , !items. isEmpty {
807
806
dropItems = items
808
807
return . move
809
808
}
@@ -835,9 +834,9 @@ public class OutlineViewDiffableDataSource<ItemIdentifierType: Hashable>: NSObje
835
834
var snapshot = snapshot ( )
836
835
snapshot. insert ( dropItems, atIndex: index, of: item as? ItemIdentifierType )
837
836
let transaction = OutlineViewDiffableDataSourceTransaction< ItemIdentifierType> . init( initial: currentSnapshot, final: snapshot)
838
- droppingHandlers. willDrop ? ( dropContent , item as? ItemIdentifierType , dropItems, transaction)
837
+ droppingHandlers. willDrop ? ( info . dropInfo ( for : outlineView ) , item as? ItemIdentifierType , dropItems, transaction)
839
838
apply ( snapshot, droppingHandlers. animates ? . animated : . withoutAnimation)
840
- droppingHandlers. didDrop ? ( dropContent , item as? ItemIdentifierType , dropItems, transaction)
839
+ droppingHandlers. didDrop ? ( info . dropInfo ( for : outlineView ) , item as? ItemIdentifierType , dropItems, transaction)
841
840
return true
842
841
}
843
842
return false
@@ -1014,13 +1013,13 @@ public class OutlineViewDiffableDataSource<ItemIdentifierType: Hashable>: NSObje
1014
1013
/// Handlers for dropping items inside the outline view.
1015
1014
public struct DroppingHandlers {
1016
1015
/// The handler that determines whether a drop with the pasteboard content is accepted.
1017
- public var canDrop : ( ( _ content : [ PasteboardReading ] , _ parent: ItemIdentifierType ? ) -> ( Bool ) ) ?
1016
+ public var canDrop : ( ( _ dropInfo : DropInfo , _ parent: ItemIdentifierType ? ) -> Bool ) ?
1018
1017
/// The handler that determinates the items to be inserted for the pasteboard content.
1019
- public var items : ( ( _ content : [ PasteboardReading ] , _ parent: ItemIdentifierType ? ) -> ( [ ItemIdentifierType ] ) ) ?
1018
+ public var items : ( ( _ dropInfo : DropInfo , _ parent: ItemIdentifierType ? ) -> ( [ ItemIdentifierType ] ) ) ?
1020
1019
/// The handler that gets called before new items are dropped.
1021
- public var willDrop : ( ( _ content : [ PasteboardReading ] , _ parent: ItemIdentifierType ? , _ newItems: [ ItemIdentifierType ] , _ transaction: OutlineViewDiffableDataSourceTransaction < ItemIdentifierType > ) -> ( ) ) ?
1020
+ public var willDrop : ( ( _ dropInfo : DropInfo , _ parent: ItemIdentifierType ? , _ newItems: [ ItemIdentifierType ] , _ transaction: OutlineViewDiffableDataSourceTransaction < ItemIdentifierType > ) -> ( ) ) ?
1022
1021
/// The handler that gets called after new items are dropped.
1023
- public var didDrop : ( ( _ content : [ PasteboardReading ] , _ parent: ItemIdentifierType ? , _ newItems: [ ItemIdentifierType ] , _ transaction: OutlineViewDiffableDataSourceTransaction < ItemIdentifierType > ) -> ( ) ) ?
1022
+ public var didDrop : ( ( _ dropInfo : DropInfo , _ parent: ItemIdentifierType ? , _ newItems: [ ItemIdentifierType ] , _ transaction: OutlineViewDiffableDataSourceTransaction < ItemIdentifierType > ) -> ( ) ) ?
1024
1023
/// A Boolean value that indicates whether dropping items is animated.
1025
1024
public var animates : Bool = false
1026
1025
/// A Boolean value that indicates whether the dropped items are previewed.
0 commit comments