Skip to content

CoreMotion macOS xcode13.0 beta1

Manuel de la Pena edited this page Jun 17, 2021 · 3 revisions

#CoreMotion.framework https://github.com/xamarin/xamarin-macios/pull/11968

diff -ruN /Applications/Xcode_12.5.0.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreMotion.framework/Headers/CMAbsoluteAltitude.h /Applications/Xcode_13.0.0-beta.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreMotion.framework/Headers/CMAbsoluteAltitude.h
--- /Applications/Xcode_12.5.0.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreMotion.framework/Headers/CMAbsoluteAltitude.h	1969-12-31 19:00:00.000000000 -0500
+++ /Applications/Xcode_13.0.0-beta.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreMotion.framework/Headers/CMAbsoluteAltitude.h	2021-06-02 11:05:08.000000000 -0400
@@ -0,0 +1,48 @@
+/*
+*  CMAbsoluteAltitude.h
+*  CoreMotion
+*
+*  Copyright (c) 2020 Apple Inc. All rights reserved.
+*
+*/
+
+#import <Foundation/Foundation.h>
+#import <CoreMotion/CMLogItem.h>
+#import <CoreMotion/CMAvailability.h>
+
+NS_ASSUME_NONNULL_BEGIN
+
+COREMOTION_EXPORT
+API_AVAILABLE(ios(15.0), watchos(8.0)) API_UNAVAILABLE(macos, tvos)
+@interface CMAbsoluteAltitudeData : CMLogItem
+
+/*
+ *  altitude
+ *
+ *  Discussion:
+ *    The absolute altitude of the device in meters relative to sea level; could be positive or negative.
+ *
+ */
+@property(readonly, nonatomic) double altitude;
+
+/*
+ *  accuracy
+ *
+ *  Discussion:
+ *    The accuracy of the altitude estimate, in meters.
+ *
+ */
+@property(readonly, nonatomic) double accuracy;
+
+/*
+ *  precision
+ *
+ *  Discussion:
+ *    The precision of the altitude estimate, in meters.
+ *
+ */
+@property(readonly, nonatomic) double precision;
+
+@end
+
+NS_ASSUME_NONNULL_END
diff -ruN /Applications/Xcode_12.5.0.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreMotion.framework/Headers/CMAltimeter.h /Applications/Xcode_13.0.0-beta.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreMotion.framework/Headers/CMAltimeter.h
--- /Applications/Xcode_12.5.0.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreMotion.framework/Headers/CMAltimeter.h	2021-03-16 09:52:37.000000000 -0400
+++ /Applications/Xcode_13.0.0-beta.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreMotion.framework/Headers/CMAltimeter.h	2021-06-02 11:05:08.000000000 -0400
@@ -10,6 +10,7 @@
 #import <CoreMotion/CMAltitude.h>
 #import <CoreMotion/CMAvailability.h>
 #import <CoreMotion/CMAuthorization.h>
+#import <CoreMotion/CMAbsoluteAltitude.h>
 
 NS_ASSUME_NONNULL_BEGIN
 
@@ -22,6 +23,15 @@
 typedef void (^CMAltitudeHandler)(CMAltitudeData * __nullable altitudeData, NSError * __nullable error) API_AVAILABLE(ios(8.0)) API_UNAVAILABLE(macos);
 
 /*
+ *  CMAbsoluteAltitudeHandler
+ *
+ *  Discussion:
+ *    Typedef of block to be invoked when the device's absolute altitude is updated.
+ */
+typedef void (^CMAbsoluteAltitudeHandler)(CMAbsoluteAltitudeData *__nullable altitudeData, NSError *__nullable error) API_AVAILABLE(ios(15.0), watchos(8.0)) API_UNAVAILABLE(macos, tvos);
+
+
+/*
  *  CMAltimeter
  *
  *  Discussion:
@@ -67,6 +77,44 @@
  */
 - (void)stopRelativeAltitudeUpdates;
 
+/*
+ *  isAbsoluteAltitudeAvailable
+ *
+ *  Discussion:
+ *      Determines whether the device supports reporting the absolute altitude.
+ */
++ (BOOL)isAbsoluteAltitudeAvailable API_AVAILABLE(ios(14.0), watchos(6.0)) API_UNAVAILABLE(macos, tvos);
+
+/*
+ *  startAbsoluteAltitudeUpdatesToQueue:withHandler:
+ *
+ *  Discussion:
+ *      Starts absolute altitude updates, providing data to the given handler on the given queue
+ *      at intervals specified by absoluteAltitudeUpdateInterval.
+ *
+ *      Calls to start must be balanced with calls to stopAbsoluteAltitudeUpdates even if an error
+ *      is returned to the handler.
+ */
+
+- (void)startAbsoluteAltitudeUpdatesToQueue:(NSOperationQueue *)queue withHandler:(CMAbsoluteAltitudeHandler)handler API_AVAILABLE(ios(14.0), watchos(6.0)) API_UNAVAILABLE(macos, tvos);
+/*
+ *  stopAbsoluteAltitudeUpdates
+ *
+ *  Discussion:
+ *      Stops absolute altitude updates.
+ */
+- (void)stopAbsoluteAltitudeUpdates API_AVAILABLE(ios(14.0), watchos(6.0)) API_UNAVAILABLE(macos, tvos);
+
+/*
+ *  absoluteAltitudeUpdateInterval
+ *
+ *  Discussion:
+ *      The interval, in seconds, at which absolute altitude data is to be delivered to the specified
+ *      handler once startAbsoluteAltitudeUpdatesToQueue:withHandler is called. The value of this
+ *      property is capped to a minimum of 250ms and a maximum of 300s. The default value is 1s.
+ */
+@property(assign, nonatomic) NSTimeInterval absoluteAltitudeUpdateInterval API_AVAILABLE(ios(14.0), watchos(6.0)) API_UNAVAILABLE(macos, tvos);
+
 @end
 
 NS_ASSUME_NONNULL_END
diff -ruN /Applications/Xcode_12.5.0.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreMotion.framework/Headers/CMHeadphoneMotionManager.h /Applications/Xcode_13.0.0-beta.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreMotion.framework/Headers/CMHeadphoneMotionManager.h
--- /Applications/Xcode_12.5.0.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreMotion.framework/Headers/CMHeadphoneMotionManager.h	2021-03-16 09:52:37.000000000 -0400
+++ /Applications/Xcode_13.0.0-beta.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreMotion.framework/Headers/CMHeadphoneMotionManager.h	2021-06-02 11:05:07.000000000 -0400
@@ -29,7 +29,7 @@
  *  Discussion:
  *    The CMHeadphoneMotionManager object is your entry point to the headphone motion service.
  */
-COREMOTION_EXPORT API_AVAILABLE(ios(14.0)) API_UNAVAILABLE(macos)
+COREMOTION_EXPORT API_AVAILABLE(ios(14.0))
 @interface CMHeadphoneMotionManager : NSObject
 
 /*
diff -ruN /Applications/Xcode_12.5.0.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreMotion.framework/Headers/CMHeadphoneMotionManagerDelegate.h /Applications/Xcode_13.0.0-beta.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreMotion.framework/Headers/CMHeadphoneMotionManagerDelegate.h
--- /Applications/Xcode_12.5.0.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreMotion.framework/Headers/CMHeadphoneMotionManagerDelegate.h	2021-03-16 09:52:38.000000000 -0400
+++ /Applications/Xcode_13.0.0-beta.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreMotion.framework/Headers/CMHeadphoneMotionManagerDelegate.h	2021-06-02 11:05:08.000000000 -0400
@@ -18,7 +18,7 @@
  *  Discussion:
  *    Delegate for CMHeadphoneMotionManager.
  */
-COREMOTION_EXPORT API_AVAILABLE(ios(14.0)) API_UNAVAILABLE(macos)
+COREMOTION_EXPORT API_AVAILABLE(ios(14.0))
 @protocol CMHeadphoneMotionManagerDelegate<NSObject>
 
 @optional
Clone this wiki locally