I'm creating an application that contains two NSCollectionView, one source, and one target, user drags the item from the source and drops to the target, the strange thing is that, if I run the App from Xcode, the drag & drop works perfectly(both validateDrop and acceptDrop were called), both Debug and Release. anyway, if I run the created application directly, the target collectionView won't show the line indicator and the dragging item always bounces back to the source collectionView, no validateDrop called.
func collectionView(_ collectionView: NSCollectionView,
validateDrop draggingInfo: NSDraggingInfo,
proposedIndexPath proposedDropIndexPath: AutoreleasingUnsafeMutablePointer<NSIndexPath>,
dropOperation proposedDropOperation: UnsafeMutablePointer<NSCollectionView.DropOperation>) -> NSDragOperation {
if collectionView == self.targetMovCollectionView
{
draggingInfo.animatesToDestination = true
return .move
}
return [];
}
What might be the issue?