0
votes

I am trying to hide/show the status bar in iOS 7 (and 6) programmatically, NOT ViewController based but method based.

For example if i press button 1 the status bar disappears, if i press button 2 the status bar appears.

I have tried all combinations here and from google, but all are viewcontroller based so far.

Does anybody have an idea how to do it, method based?

1
What do you mean by "not view controller based"? Where are these buttons you're talking about? Aren't they in a view controller's view?rdelmar
Yes they are, but i tried -(BOOL)prefersStatusBarHidden { return YES; } and that was for the whole view controller.B-Man

1 Answers

0
votes

Use the UIApplication methods

  - (void)setStatusBarHidden:(BOOL)hidden withAnimation:(UIStatusBarAnimation)animation

on the instance [UIApplication sharedApplication]