-
Notifications
You must be signed in to change notification settings - Fork 514
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[UIKit] Fix UIKit selector on TvOS (#18617)
This API was missed because the old sim intro tests are not running and we missed it. This was found while working on xcode15. The tvOS attr is missing which defaults to the min version of tvOS when it should be 15. Added a compat implementation so that the API remains. --------- Co-authored-by: GitHub Actions Autoformatter <github-actions-autoformatter@xamarin.com> Co-authored-by: Rolf Bjarne Kvinge <rolf@xamarin.com>
- Loading branch information
1 parent
e4ed7e1
commit efd020c
Showing
3 changed files
with
45 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
#if !WATCH | ||
using System; | ||
using System.Runtime.InteropServices; | ||
|
||
using ObjCRuntime; | ||
using Foundation; | ||
|
||
namespace UIKit { | ||
public partial class UIMenu { | ||
#if !XAMCORE_5_0 | ||
|
||
#if NET | ||
[SupportedOSPlatform ("tvos15.0")] | ||
[SupportedOSPlatform ("ios15.0")] | ||
[SupportedOSPlatform ("maccatalyst15.0")] | ||
#else | ||
[iOS (15, 0)] | ||
[TV (15,0)] | ||
#endif | ||
public virtual UIMenuElement [] SelectedElements { | ||
get { | ||
// check if we are on tvos earlier than 15, if so, return and empty array, else return | ||
// the correct value | ||
#if TVOS | ||
if (SystemVersion.ChecktvOS (15, 0)) { | ||
return _SelectedElements; | ||
} else { | ||
return Array.Empty<UIMenuElement> (); | ||
} | ||
#else | ||
return _SelectedElements; | ||
#endif | ||
} | ||
#endif | ||
} | ||
} | ||
} | ||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This comment was marked as outdated.
Sorry, something went wrong.
This comment was marked as outdated.
Sorry, something went wrong.
This comment was marked as outdated.
Sorry, something went wrong.
This comment was marked as outdated.
Sorry, something went wrong.
This comment was marked as outdated.
Sorry, something went wrong.