Skip to content

Commit

Permalink
[MediaAccessibility] Implement Xcode 16.0 beta 4 changes.
Browse files Browse the repository at this point in the history
  • Loading branch information
rolfbjarne committed Aug 28, 2024
1 parent e9a895a commit 2899cdb
Show file tree
Hide file tree
Showing 9 changed files with 37 additions and 7 deletions.
27 changes: 27 additions & 0 deletions src/MediaAccessibility/MediaAccessibility.cs
Original file line number Diff line number Diff line change
Expand Up @@ -309,6 +309,33 @@ public static void DidDisplayCaptions (NSAttributedString [] strings)
MACaptionAppearanceDidDisplayCaptions (array.Handle);
}
}

#if NET
[SupportedOSPlatform ("tvos18.0")]
[SupportedOSPlatform ("macos15.0")]
[SupportedOSPlatform ("ios18.0")]
[SupportedOSPlatform ("maccatalyst18.0")]
#else
[TV (18, 0), iOS (18, 0), MacCatalyst (18, 0), Mac (15, 0), Watch (11, 0)]
#endif
[DllImport (Constants.MediaAccessibilityLibrary)]
static extern byte MACaptionAppearanceIsCustomized (nint /* MACaptionAppearanceDomain */ domain);

/// <summary>Checks whether the specified style has been customized by the user.</summary>
/// <param name="domain">The style to check</param>
/// <returns>True if the specified style has been customized by the user, false otherwise.</returns>
#if NET
[SupportedOSPlatform ("tvos18.0")]
[SupportedOSPlatform ("macos15.0")]
[SupportedOSPlatform ("ios18.0")]
[SupportedOSPlatform ("maccatalyst18.0")]
#else
[TV (18, 0), iOS (18, 0), MacCatalyst (18, 0), Mac (15, 0), Watch (11, 0)]
#endif
public static bool IsCustomized (MACaptionAppearanceDomain domain)
{
return MACaptionAppearanceIsCustomized ((nint) (long) domain) != 0;
}
}

#if NET
Expand Down
10 changes: 10 additions & 0 deletions tests/monotouch-test/MediaAccessibility/CaptionAppearanceTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,16 @@ public void DidDisplayCaptions ()
a = null;
MACaptionAppearance.DidDisplayCaptions (a);
}

[Test]
public void IsCustomized ()
{
TestRuntime.AssertXcodeVersion (16, 0);

foreach (var value in Enum.GetValues<MACaptionAppearanceDomain> ()) {
Assert.That (MACaptionAppearance.IsCustomized (value), Is.EqualTo (true).Or.EqualTo (false), value.ToString ());
}
}
}
}

Expand Down

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

1 change: 0 additions & 1 deletion tests/xtro-sharpie/iOS-MediaAccessibility.todo

This file was deleted.

1 change: 0 additions & 1 deletion tests/xtro-sharpie/macOS-MediaAccessibility.todo

This file was deleted.

1 change: 0 additions & 1 deletion tests/xtro-sharpie/tvOS-MediaAccessibility.todo

This file was deleted.

0 comments on commit 2899cdb

Please sign in to comment.