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

[CoreMotion] Added support for Xcode 14.1 b1 #16118

Merged
merged 5 commits into from
Oct 7, 2022
Merged
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
114 changes: 114 additions & 0 deletions src/coremotion.cs
Original file line number Diff line number Diff line change
Expand Up @@ -859,4 +859,118 @@ interface CMRecordedPressureData {
NSDate StartDate { get; }
}

[NoMac, NoiOS, NoMacCatalyst, Watch (9,0), NoTV]
Copy link
Member

Choose a reason for hiding this comment

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

Shouldn't this be:

Suggested change
[NoMac, NoiOS, NoMacCatalyst, Watch (9,0), NoTV]
[NoMac, NoiOS, NoMacCatalyst, Watch (9,1), NoTV]

and the same for the other ones below?

Copy link
Contributor Author

@SotoiGhost SotoiGhost Oct 5, 2022

Choose a reason for hiding this comment

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

Headers say that these clases are supported on 9.0. Should we bump the version anyway?

Copy link
Member

Choose a reason for hiding this comment

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

No, that's fine

[Native]
public enum CMWaterSubmersionState : long
{
Unknown = 0,
NotSubmerged,
Submerged,
}

[NoMac, NoiOS, NoMacCatalyst, Watch (9,0), NoTV]
[Native]
public enum CMWaterSubmersionDepthState : long
{
Unknown = 0,
NotSubmerged = 100,
SubmergedShallow = 200,
SubmergedDeep = 300,
ApproachingMaxDepth = 400,
PastMaxDepth = 500,
SensorDepthError = 600,
}

[NoMac, NoiOS, NoMacCatalyst, Watch (9,0), NoTV]
[BaseType (typeof (NSObject))]
interface CMWaterSubmersionEvent : NSSecureCoding, NSCopying
{
[Export ("date")]
NSDate Date { get; }

[Export ("state")]
CMWaterSubmersionState State { get; }
}

[NoMac, NoiOS, NoMacCatalyst, Watch (9,0), NoTV]
[BaseType (typeof (NSObject))]
interface CMWaterSubmersionMeasurement : NSSecureCoding, NSCopying
{
[Export ("date")]
NSDate Date { get; }

[NullAllowed, Export ("depth")]
NSMeasurement<NSUnitLength> Depth { get; }

[NullAllowed, Export ("pressure")]
NSMeasurement<NSUnitPressure> Pressure { get; }

[Export ("surfacePressure")]
NSMeasurement<NSUnitPressure> SurfacePressure { get; }

[Export ("submersionState")]
CMWaterSubmersionDepthState SubmersionState { get; }
}

[NoMac, NoiOS, NoMacCatalyst, Watch (9,0), NoTV]
[BaseType (typeof (NSObject))]
interface CMWaterTemperature : NSSecureCoding, NSCopying
{
[Export ("date")]
NSDate Date { get; }

[Export ("temperature")]
NSMeasurement<NSUnitTemperature> Temperature { get; }

[Export ("temperatureUncertainty")]
NSMeasurement<NSUnitTemperature> TemperatureUncertainty { get; }
}

interface ICMWaterSubmersionManagerDelegate { }

[NoMac, NoiOS, NoMacCatalyst, Watch (9,0), NoTV]
#if NET
[Protocol, Model]
#else
[Protocol, Model (AutoGeneratedName = true)]
#endif
[BaseType (typeof (NSObject))]
interface CMWaterSubmersionManagerDelegate
{
[Abstract]
[Export ("manager:didUpdateEvent:")]
void DidUpdateEvent (CMWaterSubmersionManager manager, CMWaterSubmersionEvent @event);

[Abstract]
[Export ("manager:didUpdateMeasurement:")]
void DidUpdateMeasurement (CMWaterSubmersionManager manager, CMWaterSubmersionMeasurement measurement);

[Abstract]
[Export ("manager:didUpdateTemperature:")]
void DidUpdateTemperature (CMWaterSubmersionManager manager, CMWaterTemperature measurement);

[Abstract]
[Export ("manager:errorOccurred:")]
void ErrorOccurred (CMWaterSubmersionManager manager, NSError error);
}

[NoMac, NoiOS, NoMacCatalyst, Watch (9,0), NoTV]
[BaseType (typeof (NSObject))]
interface CMWaterSubmersionManager
{
[Wrap ("WeakDelegate")]
[NullAllowed]
ICMWaterSubmersionManagerDelegate Delegate { get; set; }

[NullAllowed, Export ("delegate", ArgumentSemantic.Weak)]
NSObject WeakDelegate { get; set; }

[Static]
[Export ("waterSubmersionAvailable")]
bool IsWaterSubmersionAvailable { get; }

[Static]
[Export ("authorizationStatus")]
CMAuthorizationStatus AuthorizationStatus { get; }
}
}