diff --git a/ios/RCTSensorOrientationChecker.h b/ios/RCTSensorOrientationChecker.h index fe0840e..15dc9e4 100644 --- a/ios/RCTSensorOrientationChecker.h +++ b/ios/RCTSensorOrientationChecker.h @@ -13,6 +13,8 @@ typedef void (^RCTSensorCallback) (UIInterfaceOrientation orientation); @interface RCTSensorOrientationChecker : NSObject +@property (assign, nonatomic) UIInterfaceOrientation orientation; + - (void)getDeviceOrientationWithBlock:(RCTSensorCallback)callback; - (AVCaptureVideoOrientation)convertToAVCaptureVideoOrientation:(UIInterfaceOrientation)orientation; diff --git a/ios/RCTSensorOrientationChecker.m b/ios/RCTSensorOrientationChecker.m index 5437eac..7957a13 100644 --- a/ios/RCTSensorOrientationChecker.m +++ b/ios/RCTSensorOrientationChecker.m @@ -13,7 +13,6 @@ @interface RCTSensorOrientationChecker () @property (strong, nonatomic) CMMotionManager * motionManager; -@property (assign, nonatomic) UIInterfaceOrientation orientation; @property (strong, nonatomic) RCTSensorCallback orientationCallback; @end @@ -33,6 +32,11 @@ return self; } +- (void)dealloc +{ + [self pause]; +} + - (void)resume { __weak __typeof(self) weakSelf = self;