This PR adds ASDragDropConfig.canDropItem to prevent from dropping item "without cell-shifting animation".
Please note that this behavior is different from ASDragDropConfig.canMoveItem where item can't also be dropped by this configuration but still allows cell-shifting animation to make the current dragging place an empty space until dragging is finished.
First item is not droppable by following configuration:
var dragDropConfig: ASDragDropConfig<Item> {
ASDragDropConfig<Item>(dataBinding: $items)
.canDragItem { $0.row != 0 }
.canDropItem { $0.row != 0 } // First item is not droppable or move to make empty space
}
This PR adds
ASDragDropConfig.canDropItem
to prevent from dropping item "without cell-shifting animation".Please note that this behavior is different from
ASDragDropConfig.canMoveItem
where item can't also be dropped by this configuration but still allows cell-shifting animation to make the current dragging place an empty space until dragging is finished.Screencast
https://user-images.githubusercontent.com/138476/110242398-3b818580-7f99-11eb-9161-b07b4cf53e1c.mp4
First item is not droppable by following configuration: