Skip to content

Instantly share code, notes, and snippets.

@migueldeicaza
Created July 8, 2017 02:15
Show Gist options
  • Save migueldeicaza/e22f44007e7ac093a0076276187dcb16 to your computer and use it in GitHub Desktop.
Save migueldeicaza/e22f44007e7ac093a0076276187dcb16 to your computer and use it in GitHub Desktop.
diff --git a/src/foundation.cs b/src/foundation.cs
index cfe34a87..789d1200 100644
--- a/src/foundation.cs
+++ b/src/foundation.cs
@@ -237,11 +237,6 @@ namespace XamCore.Foundation
[Wrap ("this (data, options == null ? null : options.Dictionary, out resultDocumentAttributes, ref error)")]
IntPtr Constructor (NSData data, NSAttributedStringDocumentAttributes options, out NSDictionary resultDocumentAttributes, ref NSError error);
- // From the NSItemProviderReading protocol, a special constructor.
- [Export ("initWithItemProviderData:typeIdentifier:error:")]
- [iOS (11,0), NoWatch, NoTV, Mac(10,13)]
- IntPtr Constructor (NSData providerData, string typeIdentifier, out NSError outError);
-
// From the NSItemProviderReading protocol, a static method.
[Static]
[Export ("readableTypeIdentifiersForItemProvider", ArgumentSemantic.Copy)]
@@ -8809,15 +8804,9 @@ namespace XamCore.Foundation
//[Export ("readableTypeIdentifiersForItemProvider", ArgumentSemantic.Copy)]
//string[] ReadableTypeIdentifiersForItemProvider { get; }
- //
- // This is a constructor that various classes must implement
- // NSAttributedString, UIColor and UIImage need to have this constructor
- // for user-defined implementations of this interface, we are going to
- // need to something special
- //
- //[Abstract]
- //[Export ("initWithItemProviderData:typeIdentifier:error:")]
- //INSItemProviderReading CreateFrom (NSData providerData, string typeIdentifier, [NullAllowed] NSError outError);
+ [Abstract]
+ [Export ("initWithItemProviderData:typeIdentifier:error:")]
+ IntPtr Constructor (NSData providerData, string typeIdentifier, [NullAllowed] NSError outError);
}
#if XAMCORE_2_0
diff --git a/src/uikit.cs b/src/uikit.cs
index 1a2fc0d4..68470e4c 100644
--- a/src/uikit.cs
+++ b/src/uikit.cs
@@ -4483,7 +4483,11 @@ namespace XamCore.UIKit {
// returns NIL handle causing exceptions in further calls, e.g. ToString
// Objective-C exception thrown. Name: NSInvalidArgumentException Reason: *** -CGColor not defined for the UIColor <UIPlaceholderColor: 0x114f5ad0>; need to first convert colorspace.
[DisableDefaultCtor]
- interface UIColor : NSSecureCoding, NSCopying {
+ interface UIColor : NSSecureCoding, NSCopying
+#if !WATCH
+ , NSItemProviderReading
+#endif
+ {
[Export ("colorWithWhite:alpha:")][Static]
UIColor FromWhiteAlpha (nfloat white, nfloat alpha);
@@ -4502,11 +4506,6 @@ namespace XamCore.UIKit {
[return: NullAllowed]
UIColor FromName (string name);
- // From the NSItemProviderReading protocol, a special constructor.
- [iOS (11,0), NoWatch, NoTV]
- [Export ("initWithItemProviderData:typeIdentifier:error:")]
- IntPtr Constructor (NSData providerData, string typeIdentifier, out NSError outError);
-
// From the NSItemProviderReading protocol, a static method.
[Static]
[iOS (11,0), NoWatch, NoTV]
@@ -6722,7 +6721,7 @@ namespace XamCore.UIKit {
[BaseType (typeof (NSObject))]
interface UIImage : NSSecureCoding
#if !WATCH
- , UIAccessibility, UIAccessibilityIdentification
+ , UIAccessibility, UIAccessibilityIdentification, NSItemProviderReading
#endif // !WATCH
{
[ThreadSafe]
@@ -6774,11 +6773,6 @@ namespace XamCore.UIKit {
UIImage FromImage (CIImage image);
#endif // !WATCH
- // From the NSItemProviderReading protocol, a special constructor.
- [Export ("initWithItemProviderData:typeIdentifier:error:")]
- [iOS (11,0), NoWatch, NoTV]
- IntPtr Constructor (NSData providerData, string typeIdentifier, out NSError outError);
-
// From the NSItemProviderReading protocol, a static method.
[Static]
[iOS (11,0), NoWatch, NoTV]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment