Skip to content
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] Bump to support Xcode 14.1 #16338

Merged
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
41 changes: 41 additions & 0 deletions src/NearbyInteraction/NICompat.cs
@@ -0,0 +1,41 @@
//
// NICompat.cs
//
// Copyright (C) Microsoft Corporation. All rights reserved.
//

using System;
using System.ComponentModel;
using System.Threading.Tasks;
using Foundation;
using CoreFoundation;
using ObjCRuntime;

#if __MACCATALYST__ || !IOS
using ARSession = Foundation.NSObject;
#else
using ARKit;
#endif

#if NET
using Vector3 = global::System.Numerics.Vector3;
using MatrixFloat4x4 = global::CoreGraphics.NMatrix4;
#else
using NativeHandle = System.IntPtr;
using Vector3 = global::OpenTK.Vector3;
using MatrixFloat4x4 = global::OpenTK.NMatrix4;
#endif

#nullable enable
namespace NearbyInteraction {

#if WATCH
public partial class NISession {

public virtual void SetARSession (ARSession session) => throw new InvalidOperationException (Constants.ApiRemovedGeneral);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think you need the platform supported attributes probably Obsolete?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

True, I forgot the obsolete. Good catch

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

MORE!!!

image

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nope, this is only for watch. Watch is not present on Net, so we do not need to add anything more than the Obsolete for legacy.


public virtual MatrixFloat4x4 GetWorldTransform (NINearbyObject @object) => throw new InvalidOperationException (Constants.ApiRemovedGeneral);

}
#endif
}
1 change: 1 addition & 0 deletions src/frameworks.sources
Expand Up @@ -1336,6 +1336,7 @@ NEARBYINTERACTION_API_SOURCES = \
NearbyInteraction/Enums.cs \

NEARBYINTERACTION_SOURCES = \
NearbyInteraction/NICompat.cs \
NearbyInteraction/NINearbyObject.cs \
NearbyInteraction/NIAlgorithmConvergenceStatusReasonValues.cs \

Expand Down
4 changes: 2 additions & 2 deletions src/nearbyinteraction.cs
Expand Up @@ -128,11 +128,11 @@ interface NISession
[Export ("invalidate")]
void Invalidate ();

[Watch (9,0), NoTV, NoMac, iOS (16,0), MacCatalyst (16,0)]
[NoWatch, NoTV, NoMac, iOS (16,0), MacCatalyst (16,0)]
[Export ("setARSession:")]
void SetARSession (ARSession session);

[Watch (9,0), NoTV, NoMac, iOS (16,0), MacCatalyst (16,0)]
[NoWatch, NoTV, NoMac, iOS (16,0), MacCatalyst (16,0)]
[Export ("worldTransformForObject:")]
[MarshalDirective (NativePrefix = "xamarin_simd__", Library = "__Internal")]
MatrixFloat4x4 GetWorldTransform (NINearbyObject @object);
Expand Down