Skip to content

Commit

Permalink
[NearbyInteraction] Bump to support Xcode 14.1 (#16338)
Browse files Browse the repository at this point in the history
  • Loading branch information
mandel-macaque committed Oct 17, 2022
1 parent 9a7740b commit 093b5d2
Show file tree
Hide file tree
Showing 3 changed files with 50 additions and 2 deletions.
47 changes: 47 additions & 0 deletions src/NearbyInteraction/NICompat.cs
@@ -0,0 +1,47 @@
//
// 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 {

#if !NET
[Obsolete ("This method was removed and will always throw a InvalidOperationException.")]
#endif
public virtual void SetARSession (ARSession session) => throw new InvalidOperationException (Constants.ApiRemovedGeneral);

#if !NET
[Obsolete ("This method was removed and will always throw a InvalidOperationException.")]
#endif
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

4 comments on commit 093b5d2

@vs-mobiletools-engineering-service2

This comment was marked as outdated.

@vs-mobiletools-engineering-service2

This comment was marked as outdated.

@vs-mobiletools-engineering-service2

This comment was marked as outdated.

@vs-mobiletools-engineering-service2

This comment was marked as outdated.

Please sign in to comment.