PCSDeviceOrientationManager.h 778 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. //
  2. // PCSDeviceOrientationManager.h
  3. // LenzSDK
  4. //
  5. // Created by lr on 2023/5/12.
  6. //
  7. #import <Foundation/Foundation.h>
  8. NS_ASSUME_NONNULL_BEGIN
  9. typedef NS_ENUM(NSInteger,TgDirection) {
  10. TgDirectionUnkown,
  11. TgDirectionPortrait,
  12. TgDirectionDown,
  13. TgDirectionRight,
  14. TgDirectionLeft,
  15. };
  16. @protocol PCSDeviceOrientationDelegate <NSObject>
  17. - (void)directionChange:(TgDirection)direction;
  18. @end
  19. @interface PCSDeviceOrientationManager : NSObject
  20. @property (nonatomic) id<PCSDeviceOrientationDelegate> delegate;
  21. @property (nonatomic) TgDirection currentDirection;
  22. - (instancetype)initWithDelegate:(id<PCSDeviceOrientationDelegate>) delegate;
  23. /**
  24. 开启监听
  25. */
  26. - (void)startMonitor;
  27. /**
  28. 结束监听,请stop
  29. */
  30. - (void)stop;
  31. @end
  32. NS_ASSUME_NONNULL_END