Bug 54882 - [APIBreak] NSCollectionViewDelegate.ValidateDrop has wrong signature
Summary: [APIBreak] NSCollectionViewDelegate.ValidateDrop has wrong signature
Status: CONFIRMED
Alias: None
Product: Xamarin.Mac
Classification: Desktop
Component: Library (Xamarin.Mac.dll) (show other bugs)
Version: 3.4.0 (15.2)
Hardware: Macintosh Mac OS
: --- normal
Target Milestone: ---
Assignee: Bugzilla
URL:
Depends on:
Blocks:
 
Reported: 2017-04-08 14:52 UTC by Andrew T
Modified: 2017-04-10 17:14 UTC (History)
2 users (show)

See Also:
Tags:
Is this bug a regression?: ---
Last known good build:


Attachments

Description Andrew T 2017-04-08 14:52:34 UTC
NSCollectionViewDelegate.ValidateDrop has proposedDropIndexPath and proposedDropOperation parameters marked as out parameters forcing the implementer to set them.

According to Apple's documentation, these values should be passed by reference giving the implementer the option to change them, but not require them to provide the values.
https://developer.apple.com/reference/appkit/nscollectionviewdelegate/1525471-collectionview?language=objc

A work around is to not override the delegate method and instead export it manually:
[Export("collectionView:validateDrop:proposedIndexPath:dropOperation:")]
public NSDragOperation ValidateDrop(NSCollectionView collectionView,
			            NSDraggingInfo draggingInfo,
			            ref NSIndexPath proposedDropIndexPath,
				   ref NSCollectionViewDropOperation proposedDropOperation){

}
Comment 1 Chris Hamons 2017-04-10 17:14:28 UTC
Your analysis looks correct.

I'm not sure we can fix this generally without and API break, but re-exporting is an appropriate work around.

Note You need to log in before you can comment on or make changes to this bug.