PCSMotionManager.h 1.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. //
  2. // PCSMotionManager.h
  3. // LenzCameraNativeModuleForRN
  4. //
  5. // Created by 王昭威 on 2023/1/27.
  6. //
  7. #import <Foundation/Foundation.h>
  8. #import <CoreMotion/CoreMotion.h>
  9. #import "LenzHeader.h"
  10. NS_ASSUME_NONNULL_BEGIN
  11. extern NSNotificationName const PCS_NotificationNameOrientationDidChange;
  12. typedef void(^OrientationDidChangeHandler)(UIDeviceOrientation current, UIDeviceOrientation old);
  13. @class CMAccelerometerData;
  14. @interface PCSMotionManager : NSObject
  15. @property (nonatomic, readonly) CMAccelerometerData* accelerometerData;
  16. @property(readonly, nonatomic) CMAcceleration userAcceleration;
  17. @property (nonatomic, assign, readonly) UIDeviceOrientation currentDeviceOrientation;
  18. @property (nonatomic, readonly) CMMotionManager* motionManager;
  19. + (instancetype)shared;
  20. - (AVCaptureVideoOrientation)videoOrientation:(nullable UIDeviceOrientation*)currentDeviceOrientation;
  21. // direct to core motion
  22. - (void)startAccelerometerUpdates;
  23. - (void)stopAccelerometerUpdates;
  24. - (void)startDeviceMotionUpdates;
  25. - (void)stopDeviceMotionUpdates;
  26. @end
  27. NS_ASSUME_NONNULL_END