-
Notifications
You must be signed in to change notification settings - Fork 510
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Foundation/UIKit] Provide LoadObject[s] methods that return the expected type in the callback. Fixes #59049. #2638
Conversation
|
…cted type in the callback. Fixes #59049. The callback for these LoadObject[s] methods take an INSItemProviderReading parameter. This tells our runtime that we must provide an instance of a managed object that implements this interface (but nothing else), so we create a `NSItemProviderReadingWrapper` instance, which complies with the API (since the wrapper type implements the corresponding interface). Unfortunately these methods are supposed to return an instance of the passed- in type, so in order to comply with this soft (documentation-only) requirement, provide a wrapper method that creates instances of the right types. https://bugzilla.xamarin.com/show_bug.cgi?id=59049
0ac27f8
to
dc5ff1a
Compare
Build failure |
❤️ much nicer API |
Build failure |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
❤️ it
@timrisi I don't have my High Sierra machine with me today can you try it with yours? |
Turns out both samples from the bug are iOS samples, so I was able to test both (and they work). |
Build failure |
build |
Build success |
The callback for these LoadObject[s] methods take an INSItemProviderReading parameter. This tells our runtime that we must provide an instance of a managed object that implements this interface (but nothing else), so we create a
NSItemProviderReadingWrapper
instance, which complies with the API (since the wrapper type implements the corresponding interface).Unfortunately these methods are supposed to return an instance of the passed-in type, so in order to comply with this soft (documentation-only) requirement, provide a wrapper method that creates instances of the right types.
https://bugzilla.xamarin.com/show_bug.cgi?id=59049