Skip to content

Commit

Permalink
[Symbols] Add support for the new Xcode 15 Symbols framework. (#18642)
Browse files Browse the repository at this point in the history
Co-authored-by: GitHub Actions Autoformatter <github-actions-autoformatter@xamarin.com>
Co-authored-by: Rolf Bjarne Kvinge <rolf@xamarin.com>
Co-authored-by: Alex Soto <alex@alexsoto.me>
  • Loading branch information
4 people authored Aug 15, 2023
1 parent 7988d05 commit d5d14f6
Show file tree
Hide file tree
Showing 21 changed files with 246 additions and 399 deletions.
1 change: 1 addition & 0 deletions src/frameworks.sources
Original file line number Diff line number Diff line change
Expand Up @@ -2008,6 +2008,7 @@ COMMON_FRAMEWORKS = \
OSLog \
SceneKit \
ShazamKit \
Symbols \
SoundAnalysis \
SpriteKit \
StoreKit \
Expand Down
1 change: 1 addition & 0 deletions src/rsp/dotnet/ios-defines-dotnet.rsp
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,7 @@
-d:HAS_SPEECH
-d:HAS_SPRITEKIT
-d:HAS_STOREKIT
-d:HAS_SYMBOLS
-d:HAS_SYSTEMCONFIGURATION
-d:HAS_THREADNETWORK
-d:HAS_TWITTER
Expand Down
1 change: 1 addition & 0 deletions src/rsp/dotnet/maccatalyst-defines-dotnet.rsp
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,7 @@
-d:HAS_SPEECH
-d:HAS_SPRITEKIT
-d:HAS_STOREKIT
-d:HAS_SYMBOLS
-d:HAS_SYSTEMCONFIGURATION
-d:HAS_THREADNETWORK
-d:HAS_UIKIT
Expand Down
1 change: 1 addition & 0 deletions src/rsp/dotnet/macos-defines-dotnet.rsp
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,7 @@
-d:HAS_SPEECH
-d:HAS_SPRITEKIT
-d:HAS_STOREKIT
-d:HAS_SYMBOLS
-d:HAS_SYSTEMCONFIGURATION
-d:HAS_THREADNETWORK
-d:HAS_UNIFORMTYPEIDENTIFIERS
Expand Down
1 change: 1 addition & 0 deletions src/rsp/dotnet/tvos-defines-dotnet.rsp
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@
-d:HAS_SOUNDANALYSIS
-d:HAS_SPRITEKIT
-d:HAS_STOREKIT
-d:HAS_SYMBOLS
-d:HAS_SYSTEMCONFIGURATION
-d:HAS_TVMLKIT
-d:HAS_TVSERVICES
Expand Down
1 change: 1 addition & 0 deletions src/rsp/ios-defines.rsp
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,7 @@
-d:HAS_SPEECH
-d:HAS_SPRITEKIT
-d:HAS_STOREKIT
-d:HAS_SYMBOLS
-d:HAS_SYSTEMCONFIGURATION
-d:HAS_THREADNETWORK
-d:HAS_TWITTER
Expand Down
1 change: 1 addition & 0 deletions src/rsp/macos-defines.rsp
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,7 @@
-d:HAS_SPEECH
-d:HAS_SPRITEKIT
-d:HAS_STOREKIT
-d:HAS_SYMBOLS
-d:HAS_SYSTEMCONFIGURATION
-d:HAS_THREADNETWORK
-d:HAS_UNIFORMTYPEIDENTIFIERS
Expand Down
1 change: 1 addition & 0 deletions src/rsp/tvos-defines.rsp
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@
-d:HAS_SOUNDANALYSIS
-d:HAS_SPRITEKIT
-d:HAS_STOREKIT
-d:HAS_SYMBOLS
-d:HAS_SYSTEMCONFIGURATION
-d:HAS_TVMLKIT
-d:HAS_TVSERVICES
Expand Down
1 change: 1 addition & 0 deletions src/rsp/watchos-defines.rsp
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@
-d:HAS_SOUNDANALYSIS
-d:HAS_SPRITEKIT
-d:HAS_STOREKIT
-d:HAS_SYMBOLS
-d:HAS_UIKIT
-d:HAS_UNIFORMTYPEIDENTIFIERS
-d:HAS_USERNOTIFICATIONS
Expand Down
225 changes: 225 additions & 0 deletions src/symbols.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,225 @@
using CoreFoundation;
using ObjCRuntime;
using Foundation;

using System;

namespace Symbols {
[Watch (10, 0), TV (17, 0), Mac (14, 0), iOS (17, 0), MacCatalyst (17, 0)]
[BaseType (typeof (NSObject))]
[DisableDefaultCtor]
interface NSSymbolEffect : NSCopying, NSSecureCoding { }

[Watch (10, 0), TV (17, 0), Mac (14, 0), iOS (17, 0), MacCatalyst (17, 0)]
[BaseType (typeof (NSObject))]
[DisableDefaultCtor]
interface NSSymbolContentTransition : NSCopying, NSSecureCoding { }

[Watch (10, 0), TV (17, 0), Mac (14, 0), iOS (17, 0), MacCatalyst (17, 0)]
[BaseType (typeof (NSObject))]
[DisableDefaultCtor]
interface NSSymbolEffectOptions : NSCopying, NSSecureCoding {
[Static]
[Export ("options")]
NSSymbolEffectOptions Create ();

[Static]
[Export ("optionsWithRepeating")]
NSSymbolEffectOptions CreateRepeating ();

[Export ("optionsWithRepeating")]
NSSymbolEffectOptions GetRepeating ();

[Static]
[Export ("optionsWithNonRepeating")]
NSSymbolEffectOptions CreateNonRepeating ();

[Export ("optionsWithNonRepeating")]
NSSymbolEffectOptions GetNonRepeating ();

[Static]
[Export ("optionsWithRepeatCount:")]
NSSymbolEffectOptions Create (nint repeatCount);

[Export ("optionsWithRepeatCount:")]
NSSymbolEffectOptions Get (nint repeatCount);

[Static]
[Export ("optionsWithSpeed:")]
NSSymbolEffectOptions Create (double speed);

[Export ("optionsWithSpeed:")]
NSSymbolEffectOptions Get (double speed);
}

[Watch (10, 0), TV (17, 0), Mac (14, 0), iOS (17, 0), MacCatalyst (17, 0)]
[BaseType (typeof (NSSymbolEffect))]
[DisableDefaultCtor]
interface NSSymbolPulseEffect {
[Static]
[Export ("effect")]
NSSymbolPulseEffect Create ();

[Export ("effectWithByLayer")]
NSSymbolPulseEffect ByLayer { get; }

[Export ("effectWithWholeSymbol")]
NSSymbolPulseEffect WholeSymbol { get; }
}

[Watch (10, 0), TV (17, 0), Mac (14, 0), iOS (17, 0), MacCatalyst (17, 0)]
[BaseType (typeof (NSSymbolEffect))]
[DisableDefaultCtor]
interface NSSymbolBounceEffect {
[Static]
[Export ("effect")]
NSSymbolBounceEffect Create ();

[Static]
[Export ("bounceUpEffect")]
NSSymbolBounceEffect CreateBounceUpEffect ();

[Static]
[Export ("bounceDownEffect")]
NSSymbolBounceEffect CreateBounceDownEffect ();

[Export ("effectWithByLayer")]
NSSymbolBounceEffect ByLayer { get; }

[Export ("effectWithWholeSymbol")]
NSSymbolBounceEffect WholeSymbol { get; }
}

[Watch (10, 0), TV (17, 0), Mac (14, 0), iOS (17, 0), MacCatalyst (17, 0)]
[BaseType (typeof (NSSymbolEffect))]
[DisableDefaultCtor]
interface NSSymbolVariableColorEffect {
[Static]
[Export ("effect")]
NSSymbolVariableColorEffect Create ();

[Export ("effectWithIterative")]
NSSymbolVariableColorEffect Iterative { get; }

[Export ("effectWithCumulative")]
NSSymbolVariableColorEffect Cumulative { get; }

[Export ("effectWithReversing")]
NSSymbolVariableColorEffect Reversing { get; }

[Export ("effectWithNonReversing")]
NSSymbolVariableColorEffect NonReversing { get; }

[Export ("effectWithHideInactiveLayers")]
NSSymbolVariableColorEffect HideInactiveLayers { get; }

[Export ("effectWithDimInactiveLayers")]
NSSymbolVariableColorEffect DimInactiveLayers { get; }
}

[Watch (10, 0), TV (17, 0), Mac (14, 0), iOS (17, 0), MacCatalyst (17, 0)]
[BaseType (typeof (NSSymbolEffect))]
[DisableDefaultCtor]
interface NSSymbolScaleEffect {
[Static]
[Export ("effect")]
NSSymbolScaleEffect Create ();

[Static]
[Export ("scaleUpEffect")]
NSSymbolScaleEffect CreateScaleUpEffect ();

[Static]
[Export ("scaleDownEffect")]
NSSymbolScaleEffect CreateScaleDownEffect ();

[Export ("effectWithByLayer")]
NSSymbolScaleEffect ByLayer { get; }

[Export ("effectWithWholeSymbol")]
NSSymbolScaleEffect WholeSymbol { get; }
}

[Watch (10, 0), TV (17, 0), Mac (14, 0), iOS (17, 0), MacCatalyst (17, 0)]
[BaseType (typeof (NSSymbolEffect))]
[DisableDefaultCtor]
interface NSSymbolAppearEffect {
[Static]
[Export ("effect")]
NSSymbolAppearEffect Create ();

[Static]
[Export ("appearUpEffect")]
NSSymbolAppearEffect CreateAppearUpEffect ();

[Static]
[Export ("appearDownEffect")]
NSSymbolAppearEffect CreateAppearDownEffect ();

[Export ("effectWithByLayer")]
NSSymbolAppearEffect ByLayer { get; }

[Export ("effectWithWholeSymbol")]
NSSymbolAppearEffect WholeSymbol { get; }
}

[Watch (10, 0), TV (17, 0), Mac (14, 0), iOS (17, 0), MacCatalyst (17, 0)]
[BaseType (typeof (NSSymbolEffect))]
[DisableDefaultCtor]
interface NSSymbolDisappearEffect {
[Static]
[Export ("effect")]
NSSymbolDisappearEffect Create ();

[Static]
[Export ("disappearUpEffect")]
NSSymbolDisappearEffect CreateDisappearUpEffect ();

[Static]
[Export ("disappearDownEffect")]
NSSymbolDisappearEffect CreateDisappearDownEffect ();

[Export ("effectWithByLayer")]
NSSymbolDisappearEffect ByLayer { get; }

[Export ("effectWithWholeSymbol")]
NSSymbolDisappearEffect WholeSymbol { get; }
}

[Watch (10, 0), TV (17, 0), Mac (14, 0), iOS (17, 0), MacCatalyst (17, 0)]
[BaseType (typeof (NSSymbolContentTransition))]
[DisableDefaultCtor]
interface NSSymbolReplaceContentTransition {
[Static]
[Export ("transition")]
NSSymbolReplaceContentTransition Create ();

[Static]
[Export ("replaceDownUpTransition")]
NSSymbolReplaceContentTransition CreateReplaceDownUpTransition ();

[Static]
[Export ("replaceUpUpTransition")]
NSSymbolReplaceContentTransition CreateReplaceUpUpTransition ();

[Static]
[Export ("replaceOffUpTransition")]
NSSymbolReplaceContentTransition CreateReplaceOffUpTransition ();

[Export ("transitionWithByLayer")]
NSSymbolReplaceContentTransition ByLayer { get; }

[Export ("transitionWithWholeSymbol")]
NSSymbolReplaceContentTransition WholeSymbol { get; }
}

[Watch (10, 0), TV (17, 0), Mac (14, 0), iOS (17, 0), MacCatalyst (17, 0)]
[BaseType (typeof (NSSymbolContentTransition))]
[DisableDefaultCtor]
interface NSSymbolAutomaticContentTransition {
[Static]
[Export ("transition")]
NSSymbolAutomaticContentTransition Create ();
}

}
1 change: 1 addition & 0 deletions tests/mtouch/RegistrarTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -351,6 +351,7 @@ public void MT4134 ()
new { Framework = "PushToTalk", Version = "16.0" },
new { Framework = "SharedWithYou", Version = "16.0" },
new { Framework = "SharedWithYouCore", Version = "16.0" },
new { Framework = "Symbols", Version = "17.0" },
};
foreach (var framework in invalidFrameworks)
mtouch.AssertError (4134, $"Your application is using the '{framework.Framework}' framework, which isn't included in the iOS SDK you're using to build your app (this framework was introduced in iOS {framework.Version}, while you're building with the iOS {mtouch.Sdk} SDK.) Please select a newer SDK in your app's iOS Build options.");
Expand Down
57 changes: 0 additions & 57 deletions tests/xtro-sharpie/api-annotations-dotnet/iOS-Symbols.todo

This file was deleted.

Loading

1 comment on commit d5d14f6

@vs-mobiletools-engineering-service2

This comment was marked as outdated.

Please sign in to comment.