myell0w / MTStatusBarOverlay

A custom iOS status bar overlay seen in Apps like Reeder, Evernote and Google Mobile App
MIT License
1.92k stars 325 forks source link

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

Closed scheinem closed 11 years ago

scheinem commented 11 years ago

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 commented 11 years ago

Thanks!

yoyokko commented 11 years ago

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.