Skip to content

CoreMotion iOS xcode16.0 b1

Rolf Bjarne Kvinge edited this page Jul 11, 2024 · 3 revisions

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

diff -ruN /Applications/Xcode_15.4.0.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/CoreMotion.framework/Headers/CMHeadphoneActivityManager.h /Applications/Xcode_16.0.0-beta.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/CoreMotion.framework/Headers/CMHeadphoneActivityManager.h
--- /Applications/Xcode_15.4.0.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/CoreMotion.framework/Headers/CMHeadphoneActivityManager.h	1970-01-01 01:00:00
+++ /Applications/Xcode_16.0.0-beta.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/CoreMotion.framework/Headers/CMHeadphoneActivityManager.h	2024-05-31 07:37:27
@@ -0,0 +1,135 @@
+/*
+ *  CMHeadphoneActivityManager.h
+ *  CoreMotion
+ *
+ *  Copyright (c) 2024 Apple Inc. All rights reserved.
+ *
+ */
+
+#import <Foundation/Foundation.h>
+#import <CoreMotion/CMMotionActivity.h>
+#import <CoreMotion/CMAvailability.h>
+#import <CoreMotion/CMAuthorization.h>
+
+NS_ASSUME_NONNULL_BEGIN
+
+#if defined(TARGET_OS_VISION) && TARGET_OS_VISION
+#define CM_VISION_OS_AVAILABLE API_UNAVAILABLE(visionos)
+#else
+#define CM_VISION_OS_AVAILABLE
+#endif
+
+typedef NS_ENUM(NSInteger, CMHeadphoneActivityStatus) {
+	CMHeadphoneActivityStatusDisconnected = 0,
+	CMHeadphoneActivityStatusConnected,
+} NS_SWIFT_NAME(CMHeadphoneActivityManager.Status);
+
+/*
+ *  CMHeadphoneActivityStatusHandler
+ *
+ *  Discussion:
+ *    Typedef of block to be invoked when status updates are available.
+ */
+typedef void (^CMHeadphoneActivityStatusHandler)(CMHeadphoneActivityStatus status, NSError * __nullable error) NS_SWIFT_NAME(CMHeadphoneActivityManager.StatusHandler);
+
+/*
+ *  CMHeadphoneActivityHandler
+ *
+ *  Discussion:
+ *    Typedef of block to be invoked when headphone motion activity data is available. Currently automotive and cycling are not supported.
+ */
+typedef void (^CMHeadphoneActivityHandler)(CMMotionActivity * __nullable activity, NSError * __nullable error) NS_SWIFT_NAME(CMHeadphoneActivityManager.ActivityHandler) CM_VISION_OS_AVAILABLE;
+
+
+/*
+ *  CMHeadphoneActivityManager
+ *
+ *  Discussion:
+ *    The CMHeadphoneActivityManager object is your entry point to the headphone activity service.
+ */
+COREMOTION_EXPORT API_AVAILABLE(macos(15.0), ios(18.0), watchos(11.0)) CM_VISION_OS_AVAILABLE
+
+@interface CMHeadphoneActivityManager : NSObject
+
+/*
+ *  authorizationStatus
+ *
+ *  Discussion:
+ *    Returns the current authorization status for headphone activity.
+ */
++ (CMAuthorizationStatus)authorizationStatus;
+
+/*
+ *  activityAvailable
+ *
+ *  Discussion:
+ *    Determines whether headphone motion activity is available.
+ */
+@property(readonly, nonatomic, getter=isActivityAvailable) BOOL activityAvailable;
+
+/*
+ *  activityActive
+ *
+ *  Discussion:
+ *    Determines whether the CMHeadphoneActivityManager is currently providing
+ *    headphone motion activity updates.
+ */
+@property(readonly, nonatomic, getter=isActivityActive) BOOL activityActive;
+
+/*
+ *  statusAvailable
+ *
+ *  Discussion:
+ *    Determines whether headphone status is available.
+ */
+@property(readonly, nonatomic, getter=isStatusAvailable) BOOL statusAvailable;
+
+/*
+ *  statusActive
+ *
+ *  Discussion:
+ *    Determines whether the CMHeadphoneActivityManager is currently providing
+ *    status updates.
+ */
+@property(readonly, nonatomic, getter=isStatusActive) BOOL statusActive;
+
+/*
+ *  startActivityUpdatesToQueue:withHandler:
+ *
+ *  Discussion:
+ *    Starts headphone activity updates, providing data to the given handler through the given queue.
+ *
+ */
+- (void)startActivityUpdatesToQueue:(NSOperationQueue *)queue withHandler:(CMHeadphoneActivityHandler)handler;
+
+/*
+ *  stopActivityUpdates
+ *
+ *  Discussion:
+ *    Stops headphone activity updates.
+ */
+- (void)stopActivityUpdates;
+
+/*
+ *  startStatusUpdatesToQueue:withHandler:
+ *
+ *  Discussion:
+ *    Starts headphone status updates (CMHeadphoneActivityStatusConnected and CMHeadphoneActivityStatusDisconnected),
+ *    providing data to the given handler through the given queue.
+ *
+ */
+- (void)startStatusUpdatesToQueue:(NSOperationQueue *)queue withHandler:(CMHeadphoneActivityStatusHandler)handler;
+
+/*
+ *  stopStatusUpdates
+ *
+ *  Discussion:
+ *    Stops headphone status updates.
+ */
+- (void)stopStatusUpdates;
+
+@end
+
+#undef CM_VISION_OS_AVAILABLE
+
+NS_ASSUME_NONNULL_END
diff -ruN /Applications/Xcode_15.4.0.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/CoreMotion.framework/Headers/CMHeadphoneMotionManager.h /Applications/Xcode_16.0.0-beta.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/CoreMotion.framework/Headers/CMHeadphoneMotionManager.h
--- /Applications/Xcode_15.4.0.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/CoreMotion.framework/Headers/CMHeadphoneMotionManager.h	2024-05-02 05:28:04
+++ /Applications/Xcode_16.0.0-beta.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/CoreMotion.framework/Headers/CMHeadphoneMotionManager.h	2024-05-31 07:37:27
@@ -30,9 +30,9 @@
  *    The CMHeadphoneMotionManager object is your entry point to the headphone motion service.
  */
 #if defined(TARGET_OS_VISION) && TARGET_OS_VISION
-COREMOTION_EXPORT API_AVAILABLE(macos(14.0), ios(14.0)) API_UNAVAILABLE(visionos)
+COREMOTION_EXPORT API_AVAILABLE(macos(14.0), ios(14.0), watchos(7.0)) API_UNAVAILABLE(visionos)
 #else
-COREMOTION_EXPORT API_AVAILABLE(macos(14.0), ios(14.0))
+COREMOTION_EXPORT API_AVAILABLE(macos(14.0), ios(14.0), watchos(7.0))
 #endif // defined(TARGET_OS_VISION) && TARGET_OS_VISION
 @interface CMHeadphoneMotionManager : NSObject
 
diff -ruN /Applications/Xcode_15.4.0.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/CoreMotion.framework/Headers/CMHeadphoneMotionManagerDelegate.h /Applications/Xcode_16.0.0-beta.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/CoreMotion.framework/Headers/CMHeadphoneMotionManagerDelegate.h
--- /Applications/Xcode_15.4.0.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/CoreMotion.framework/Headers/CMHeadphoneMotionManagerDelegate.h	2024-05-02 05:28:05
+++ /Applications/Xcode_16.0.0-beta.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/CoreMotion.framework/Headers/CMHeadphoneMotionManagerDelegate.h	2024-05-31 07:37:28
@@ -19,9 +19,9 @@
  *    Delegate for CMHeadphoneMotionManager.
  */
 #if defined(TARGET_OS_VISION) && TARGET_OS_VISION
-COREMOTION_EXPORT API_AVAILABLE(macos(14.0), ios(14.0)) API_UNAVAILABLE(visionos)
+COREMOTION_EXPORT API_AVAILABLE(macos(14.0), ios(14.0), watchos(7.0)) API_UNAVAILABLE(visionos)
 #else
-COREMOTION_EXPORT API_AVAILABLE(macos(14.0), ios(14.0))
+COREMOTION_EXPORT API_AVAILABLE(macos(14.0), ios(14.0), watchos(7.0))
 #endif // defined(TARGET_OS_VISION) && TARGET_OS_VISION
 @protocol CMHeadphoneMotionManagerDelegate<NSObject>
 
diff -ruN /Applications/Xcode_15.4.0.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/CoreMotion.framework/Headers/CMMotionActivity.h /Applications/Xcode_16.0.0-beta.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/CoreMotion.framework/Headers/CMMotionActivity.h
--- /Applications/Xcode_15.4.0.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/CoreMotion.framework/Headers/CMMotionActivity.h	2024-05-02 05:28:04
+++ /Applications/Xcode_16.0.0-beta.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/CoreMotion.framework/Headers/CMMotionActivity.h	2024-05-31 07:37:27
@@ -47,9 +47,9 @@
  *
  */
 #if defined(TARGET_OS_VISION) && TARGET_OS_VISION
-COREMOTION_EXPORT API_AVAILABLE(ios(7.0)) API_UNAVAILABLE(macos, visionos)
+COREMOTION_EXPORT API_AVAILABLE(ios(7.0), macos(15.0)) API_UNAVAILABLE(visionos)
 #else
-COREMOTION_EXPORT API_AVAILABLE(ios(7.0)) API_UNAVAILABLE(macos)
+COREMOTION_EXPORT API_AVAILABLE(ios(7.0), macos(15.0))
 #endif // defined(TARGET_OS_VISION) && TARGET_OS_VISION
 @interface CMMotionActivity : CMLogItem
 
diff -ruN /Applications/Xcode_15.4.0.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/CoreMotion.framework/Headers/CoreMotion.h /Applications/Xcode_16.0.0-beta.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/CoreMotion.framework/Headers/CoreMotion.h
--- /Applications/Xcode_15.4.0.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/CoreMotion.framework/Headers/CoreMotion.h	2024-05-02 05:28:02
+++ /Applications/Xcode_16.0.0-beta.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/CoreMotion.framework/Headers/CoreMotion.h	2024-05-31 07:37:25
@@ -39,5 +39,6 @@
 #import <CoreMotion/CMOdometer.h>
 #import <CoreMotion/CMWaterSubmersionManager.h>
 #import <CoreMotion/CMBatchedSensorManager.h>
+#import <CoreMotion/CMHeadphoneActivityManager.h>
 
 #endif /* __COREMOTION__ */
Clone this wiki locally