diff --git a/src/CoreML/MLModelCollection.cs b/src/CoreML/MLModelCollection.cs new file mode 100644 index 000000000000..35f2b33e2cfc --- /dev/null +++ b/src/CoreML/MLModelCollection.cs @@ -0,0 +1,40 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +using System.ComponentModel; + +#nullable enable + +namespace CoreML; + +#if !XAMCORE_5_0 && !__TVOS__ +partial class MLModelCollection : NSObject { + /// This property always returns . + [EditorBrowsable (EditorBrowsableState.Never)] + [Obsolete ("This property always returns null.")] + public static NSString? DidChangeNotification { + get { + return null; + } + } + + public static partial class Notifications { + /// This method does nothing, and only returns a placeholder instance. + [EditorBrowsable (EditorBrowsableState.Never)] + [Obsolete ("This method does nothing.")] + public static NSObject ObserveDidChange (EventHandler handler) + { + return new NSObject (); + } + + /// This method does nothing, and only returns a placerholder instance. + [EditorBrowsable (EditorBrowsableState.Never)] + [Obsolete ("This method does nothing.")] + public static NSObject ObserveDidChange (NSObject objectToObserve, EventHandler handler) + { + return new NSObject (); + } + } +} +#endif // !XAMCORE_5_0 && !__TVOS__ + diff --git a/src/coreml.cs b/src/coreml.cs index d0280d743d27..b723bf9afee6 100644 --- a/src/coreml.cs +++ b/src/coreml.cs @@ -1609,10 +1609,6 @@ interface MLModelCollection { [Async] [Export ("endAccessingModelCollectionWithIdentifier:completionHandler:")] void EndAccessingModelCollection (string identifier, Action completionHandler); - - [Notification] - [Field ("MLModelCollectionDidChangeNotification")] - NSString DidChangeNotification { get; } } #endif // !XAMCORE_5_0 diff --git a/src/frameworks.sources b/src/frameworks.sources index 6573e8e10f1b..e77745300aed 100644 --- a/src/frameworks.sources +++ b/src/frameworks.sources @@ -624,6 +624,7 @@ COREMIDI_SOURCES = \ COREML_SOURCES = \ CoreML/MLDictionaryFeatureProvider.cs \ CoreML/MLModel.cs \ + CoreML/MLModelCollection.cs \ CoreML/MLMultiArray.cs \ CoreML/MLMultiArrayConstraint.cs \ diff --git a/tests/cecil-tests/Documentation.KnownFailures.txt b/tests/cecil-tests/Documentation.KnownFailures.txt index d72c2afc6991..17ed7d6c4b51 100644 --- a/tests/cecil-tests/Documentation.KnownFailures.txt +++ b/tests/cecil-tests/Documentation.KnownFailures.txt @@ -29013,6 +29013,7 @@ T:CoreML.MLModelAsset T:CoreML.MLModelAssetGetFunctionNamesCompletionHandler T:CoreML.MLModelAssetGetModelDescriptionCompletionHandler T:CoreML.MLModelCollection +T:CoreML.MLModelCollection.Notifications T:CoreML.MLModelCollectionEntry T:CoreML.MLModelConfiguration T:CoreML.MLModelStructure diff --git a/tests/xtro-sharpie/api-annotations-dotnet/MacCatalyst-CoreML.ignore b/tests/xtro-sharpie/api-annotations-dotnet/MacCatalyst-CoreML.ignore index 4f14e504809e..0d896ca7254b 100644 --- a/tests/xtro-sharpie/api-annotations-dotnet/MacCatalyst-CoreML.ignore +++ b/tests/xtro-sharpie/api-annotations-dotnet/MacCatalyst-CoreML.ignore @@ -1,5 +1,4 @@ # These types are marked as unavailable in the headers if the min OS version is >= Xcode 16's OS versions, so xtro doesn't detect them as available. # We're removing them in XAMCORE_5_0. -!unknown-field! MLModelCollectionDidChangeNotification bound !unknown-type! MLModelCollection bound !unknown-type! MLModelCollectionEntry bound diff --git a/tests/xtro-sharpie/api-annotations-dotnet/iOS-CoreML.ignore b/tests/xtro-sharpie/api-annotations-dotnet/iOS-CoreML.ignore index 4f14e504809e..0d896ca7254b 100644 --- a/tests/xtro-sharpie/api-annotations-dotnet/iOS-CoreML.ignore +++ b/tests/xtro-sharpie/api-annotations-dotnet/iOS-CoreML.ignore @@ -1,5 +1,4 @@ # These types are marked as unavailable in the headers if the min OS version is >= Xcode 16's OS versions, so xtro doesn't detect them as available. # We're removing them in XAMCORE_5_0. -!unknown-field! MLModelCollectionDidChangeNotification bound !unknown-type! MLModelCollection bound !unknown-type! MLModelCollectionEntry bound diff --git a/tests/xtro-sharpie/api-annotations-dotnet/macOS-CoreML.ignore b/tests/xtro-sharpie/api-annotations-dotnet/macOS-CoreML.ignore index 4f14e504809e..0d896ca7254b 100644 --- a/tests/xtro-sharpie/api-annotations-dotnet/macOS-CoreML.ignore +++ b/tests/xtro-sharpie/api-annotations-dotnet/macOS-CoreML.ignore @@ -1,5 +1,4 @@ # These types are marked as unavailable in the headers if the min OS version is >= Xcode 16's OS versions, so xtro doesn't detect them as available. # We're removing them in XAMCORE_5_0. -!unknown-field! MLModelCollectionDidChangeNotification bound !unknown-type! MLModelCollection bound !unknown-type! MLModelCollectionEntry bound