ios - childViewControllerForStatusBarHidden For Hiding -
i trying hide half of status bar. specifically, using refrostedviewcontroller side drawer, , when comes out, go on status such in picture (the app google's inbox).
the current hierarchy of uiviewcontroller so:
- refrostedviewcontroller |--menuviewcontroller |--navigationcontroler |--contentviewcontroller
i have uiviewcontrollerbasedstatusbarappearance
set yes
. in drawer menu (menuviewcontroller) have method
- (bool)prefersstatusbarhidden { return yes; }
in navigation controller have:
- (uiviewcontroller *)childviewcontrollerforstatusbarhidden { return self.frostedviewcontroller.menuviewcontroller; }
this hides status bar in screens. when
- (uiviewcontroller *)childviewcontrollerforstatusbarhidden { if (self.isdraweropen) { return self.frostedviewcontroller.menuviewcontroller; } else { return self.frostedviewcontroller.contentviewcontroller; } }
it crashes. self.frostedviewcontroller.contentviewcontroller
holds navigationcontroller (which has prefersstatusbarhidden
method implemented)
Comments
Post a Comment