Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Overwrite UIWindows's standard rootViewController getter for iOS 7 status bar handling #78

Merged
merged 1 commit into from

3 participants

@scheinem

As of iOS 7 an application is looking for the top most window (regarding to it's level) to access it's rootViewController to access methods like 'preferStatusBarHidden'. Because MTStatusBarOverlay must has a higher windowLevel than the keyWindow (if the keyWindow is fullscreen) the application takes MTStatusBarOverlay rootViewController which makes the keyWindow's view controllers unable to modifiy the visiblity and style of the status bar under iOS 7.

Therefore I've overwritten the MTStatusBarOverlay's rootViewController getter to return the keyWindow's rootViewController.

@myell0w myell0w merged commit 8d2a565 into from
@myell0w
Owner

Thanks!

@yoyokko

iOS 7 an application is looking for the top most shown window (regarding to it's level) to access it's rootViewController to access methods like 'preferStatusBarHidden'.
If the overlay is hidden (not alpha = 0), setting rootViewController to nil is fine.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Sep 5, 2013
  1. @scheinem
This page is out of date. Refresh to see the latest.
Showing with 9 additions and 0 deletions.
  1. +9 −0 MTStatusBarOverlay.m
View
9 MTStatusBarOverlay.m
@@ -476,6 +476,15 @@ - (void)dealloc {
////////////////////////////////////////////////////////////////////////
#pragma mark -
+#pragma mark UIWindow
+////////////////////////////////////////////////////////////////////////
+
+- (UIViewController *)rootViewController {
+ return [[UIApplication sharedApplication] keyWindow].rootViewController;
+}
+
+////////////////////////////////////////////////////////////////////////
+#pragma mark -
#pragma mark Status Bar Appearance
////////////////////////////////////////////////////////////////////////
Something went wrong with that request. Please try again.