-
Notifications
You must be signed in to change notification settings - Fork 519
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[NearbyInteraction] Updates for Xcode14 Beta 1 #15840
Merged
mandel-macaque
merged 7 commits into
dotnet:xcode14
from
tj-devel709:xcode14-NearbyInteraction-beta1
Sep 6, 2022
Merged
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
f88415f
starting NearbyInteractions
611cd93
Allow manual bindings to pass
c8ab78b
Remove extra file and spruce up some comments
0ec34eb
simplify if
c735e82
add attributes and null check to manual file
5eab7f2
legacy ios intro did not like double unsupported attributes
7269ce6
Merge branch 'xcode14' into xcode14-NearbyInteraction-beta1
tj-devel709 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
52 changes: 52 additions & 0 deletions
52
src/NearbyInteraction/NIAlgorithmConvergenceStatusReasonValues.cs
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,52 @@ | ||
// | ||
// NIAlgorithmConvergenceStatusReasonDescription manual binding | ||
// | ||
// Authors: | ||
// TJ Lambert <TJ.Lambert@microsoft.com> | ||
// | ||
// Copyright 2022 Microsoft Corp. | ||
// | ||
|
||
#if IOS || WATCH || __MACCATALYST__ | ||
|
||
#nullable enable | ||
|
||
using System; | ||
using System.Runtime.InteropServices; | ||
using CoreFoundation; | ||
using Foundation; | ||
using ObjCRuntime; | ||
|
||
#if !NET | ||
using NativeHandle = System.IntPtr; | ||
#endif | ||
|
||
namespace NearbyInteraction { | ||
public partial class NIAlgorithmConvergenceStatusReasonValues | ||
{ | ||
#if NET | ||
[SupportedOSPlatform ("ios16.0")] | ||
[SupportedOSPlatform ("maccatalyst16.0")] | ||
[UnsupportedOSPlatform ("tvos")] | ||
[UnsupportedOSPlatform ("macos")] | ||
#else | ||
[iOS (16,0), NoMac, Watch (9,0), NoTV, MacCatalyst (16,0)] | ||
#endif // NET | ||
[DllImport (Constants.NearbyInteractionLibrary)] | ||
static extern NativeHandle /* NSString */ NIAlgorithmConvergenceStatusReasonDescription (NativeHandle /* NIAlgorithmConvergenceStatusReason */ reason); | ||
|
||
#if NET | ||
[SupportedOSPlatform ("ios16.0")] | ||
[SupportedOSPlatform ("maccatalyst16.0")] | ||
[UnsupportedOSPlatform ("tvos")] | ||
[UnsupportedOSPlatform ("macos")] | ||
#else | ||
[iOS (16,0), NoMac, Watch (9,0), NoTV, MacCatalyst (16,0)] | ||
#endif // NET | ||
public static NSString GetConvergenceStatusReason (NIAlgorithmConvergenceStatusReason reason) | ||
{ | ||
return Runtime.GetNSObject<NSString> (NIAlgorithmConvergenceStatusReasonDescription (reason.GetConstant ().GetHandle ()))!; | ||
} | ||
} | ||
} | ||
#endif // IOS || WATCH || __MACCATALYST__ |
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 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
33 changes: 33 additions & 0 deletions
33
tests/monotouch-test/NearbyInteraction/NIAlgorithmConvergenceStatusReasonValuesTest.cs
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,33 @@ | ||
// Copyright 2022 Microsoft Corp. | ||
|
||
#if IOS || WATCH || __MACCATALYST__ | ||
|
||
using System; | ||
using Foundation; | ||
using ObjCRuntime; | ||
using NearbyInteraction; | ||
using NUnit.Framework; | ||
using Xamarin.Utils; | ||
|
||
namespace MonoTouchFixtures.NearbyInteraction { | ||
|
||
[TestFixture] | ||
[Preserve (AllMembers = true)] | ||
public class NIAlgorithmConvergenceStatusReasonValuesTest { | ||
|
||
[SetUp] | ||
public void Setup () | ||
{ | ||
TestRuntime.AssertXcodeVersion (14, 0); | ||
} | ||
|
||
[Test] | ||
public void GetConvergenceStatusReasonTest () | ||
{ | ||
var reason = NIAlgorithmConvergenceStatusReason.InsufficientHorizontalSweep; | ||
Assert.IsNotNull (NIAlgorithmConvergenceStatusReasonValues.GetConvergenceStatusReason (reason), "NIAlgorithmConvergenceStatusReason should not be null."); | ||
} | ||
} | ||
} | ||
|
||
#endif // IOS || WATCH || __MACCATALYST__ |
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
27 changes: 0 additions & 27 deletions
27
tests/xtro-sharpie/api-annotations-dotnet/iOS-NearbyInteraction.todo
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this will crash if executed on an earlier OS version (where the native field doesn't exist).
Something like this should work instead:
The property also needs availability attributes.