Bug 58079 - UIDropSession loadObjects: is called Completion
Summary: UIDropSession loadObjects: is called Completion
Status: RESOLVED FIXED
Alias: None
Product: iOS
Classification: Xamarin
Component: Xamarin.iOS.dll ()
Version: XI 10.99 (xcode9)
Hardware: PC Mac OS
: Normal normal
Target Milestone: Xcode9
Assignee: Vincent Dondain [MSFT]
URL:
Depends on:
Blocks:
 
Reported: 2017-07-11 15:50 UTC by Frank A. Krueger
Modified: 2017-07-13 22:46 UTC (History)
4 users (show)

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

Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and Mono organizations on GitHub to continue tracking issues. Bugzilla will remain available for reference in read-only mode. We will continue to work on open Bugzilla bugs, copy them to the new locations as needed for follow-up, and add the new items under Related Links.

Our sincere thanks to everyone who has contributed on this bug tracker over the years. Thanks also for your understanding as we make these adjustments and improvements for the future.


Please create a new report on Developer Community or GitHub with your current version information, steps to reproduce, and relevant error messages or log files if you are hitting an issue that looks similar to this resolved bug and you do not yet see a matching new report.

Related Links:
Status:
RESOLVED FIXED

Description Frank A. Krueger 2017-07-11 15:50:10 UTC
I don't think this function should be called "Completion". Instead it should be called "LoadObjects" or "LoadObjectsOfClass" to match "CanLoadObjectsOfClass"

https://github.com/xamarin/xamarin-macios/blob/xcode9/src/uikit.cs#L16377
Comment 1 Vincent Dondain [MSFT] 2017-07-11 19:41:16 UTC
Yes I agree with you that for the "loadObjectsOfClass:completion:" selector we should have: `LoadObjects` (not LoadObjectsOfClass IMHO) and we should rename `CanLoadObjectsOfClass` to `CanLoadObjects`

Swift version:

session.loadObjects(ofClass: UIImage.self) { imageItems in
        let images = imageItems as! [UIImage]

        /*
             If you do not employ the loadObjects(ofClass:completion:) convenience
             method of the UIDropSession class, which automatically employs
             the main thread, explicitly dispatch UI work to the main thread.
             For example, you can use `DispatchQueue.main.async` method.
        */
        self.imageView.image = images.first
}
Comment 2 Sebastien Pouliot 2017-07-11 20:02:03 UTC
"Completion" is likely a tooling error that was missed when reviewed the PR.

The swift names are generally a lot closer to the one .net uses. In doubt it's the one we should be using.
Comment 3 Alex Soto [MSFT] 2017-07-11 20:28:34 UTC
+1 on changing the name to "LoadObjects"
Comment 4 Vincent Dondain [MSFT] 2017-07-11 20:40:48 UTC
In progress: https://github.com/xamarin/xamarin-macios/pull/2314
Comment 5 Vincent Dondain [MSFT] 2017-07-13 22:46:01 UTC
PR merged to xcode9 branch.