From 7054919e3ecb9f2d7e7b68ed4d39153512243971 Mon Sep 17 00:00:00 2001 From: Ryan Olson Date: Sun, 24 Aug 2014 22:40:07 -0700 Subject: [PATCH] Respect child view controller status bar forwarding --- .../FLEXExplorerViewController.m | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/Classes/Explorer Toolbar/FLEXExplorerViewController.m b/Classes/Explorer Toolbar/FLEXExplorerViewController.m index 725c4f47c0..be8e035028 100644 --- a/Classes/Explorer Toolbar/FLEXExplorerViewController.m +++ b/Classes/Explorer Toolbar/FLEXExplorerViewController.m @@ -145,7 +145,13 @@ - (UIStatusBarStyle)preferredStatusBarStyle UIViewController *viewControllerToAsk = [self viewControllerForStatusBarAndOrientationProperties]; UIStatusBarStyle preferredStyle = UIStatusBarStyleDefault; if (viewControllerToAsk && viewControllerToAsk != self) { - preferredStyle = [viewControllerToAsk preferredStatusBarStyle]; + // We might need to foward to a child + UIViewController *childViewControllerToAsk = [viewControllerToAsk childViewControllerForStatusBarStyle]; + if (childViewControllerToAsk) { + preferredStyle = [childViewControllerToAsk preferredStatusBarStyle]; + } else { + preferredStyle = [viewControllerToAsk preferredStatusBarStyle]; + } } return preferredStyle; } @@ -165,7 +171,13 @@ - (BOOL)prefersStatusBarHidden UIViewController *viewControllerToAsk = [self viewControllerForStatusBarAndOrientationProperties]; BOOL prefersHidden = NO; if (viewControllerToAsk && viewControllerToAsk != self) { - prefersHidden = [viewControllerToAsk prefersStatusBarHidden]; + // Again, we might need to forward to a child + UIViewController *childViewControllerToAsk = [viewControllerToAsk childViewControllerForStatusBarHidden]; + if (childViewControllerToAsk) { + prefersHidden = [childViewControllerToAsk prefersStatusBarHidden]; + } else { + prefersHidden = [viewControllerToAsk prefersStatusBarHidden]; + } } return prefersHidden; }