From 24f904a166153b4e1cd2204f927f47efca55f952 Mon Sep 17 00:00:00 2001 From: Ben Turley Date: Sat, 9 May 2015 21:46:36 -0600 Subject: [PATCH] Fix for old/wrong values being returned when triggered by device orientation change --- Viewport.m | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Viewport.m b/Viewport.m index 12e661a..dfbd498 100644 --- a/Viewport.m +++ b/Viewport.m @@ -39,8 +39,8 @@ - (instancetype)init _lastKnownDimensions = RCTCurrentDimensions(); [[NSNotificationCenter defaultCenter] addObserver:self - selector:@selector(deviceOrientationDidChangeNotification:) - name:UIDeviceOrientationDidChangeNotification + selector:@selector(statusBarOrientationDidChangeNotification:) + name:UIApplicationDidChangeStatusBarOrientationNotification object:nil]; } @@ -54,7 +54,7 @@ - (void)dealloc #pragma mark - Notification methods -- (void)deviceOrientationDidChangeNotification:(NSNotification*)note +- (void)statusBarOrientationDidChangeNotification:(NSNotification*)note { _lastKnownDimensions = RCTCurrentDimensions(); [_bridge.eventDispatcher sendDeviceEventWithName:@"dimensionsDidChange" body:_lastKnownDimensions];