I'm creating a viewcontroller that contains two separate UICollectionViews. I'm allowing for cells to be dragged from one UICollectionView to another. In the method
-(void)collectionView:(UICollectionView *)collectionView performDropWithCoordinator:(id<UICollectionViewDropCoordinator>)coordinator;
I get the dragged item like this
UIDragItem *item = [coordinator.items objectAtIndex:0];
To determine if the drag originated from the same UICollectionView, I want to check the property sourceIndexPath
on the item
object as documented on https://developer.apple.com/documentation/uikit/uicollectionviewdropitem/2897392-sourceindexpath?language=objc
Unfortunately, Xcode keeps telling me Property 'sourceIndexPath' not found on object of type 'UIDragItem *'
When I print out item
, I clearly see the property is available, the nil value is of no importance here, it indicates the drag source.
<_UICollectionViewDropItem:0x60000189a760 previewSize = {50, 50}; sourceIndexPath = (nil); dragItem = <_UIDropItem: 0x60000240a0a0>>
I'm really stuck here, and feels like I'm forgetting to implement some protocol, but double triple checked and everything seems fine. Thanks!