I want to hide/show status bar when user taps a button. Here is how i do it:
// Hide
[[UIApplication sharedApplication] setStatusBarHidden:YES
withAnimation:UIStatusBarAnimationFade];
// Show
[[UIApplication sharedApplication] setStatusBarHidden:NO
withAnimation:UIStatusBarAnimationFade];
This brakes UI layout, because view is moved up. I selected all Extend Edges options, but it didn't help.

I discovered that layout changes because of view height:
- (void)viewDidLayoutSubviews
{
[super viewDidLayoutSubviews];
NSLog(@"%@", NSStringFromCGRect(self.navigationController.view.frame));
}
It logs:
{{0, 0}, {320, 568}} - when Status Bar is hidden.
{{0, 0}, {320, 588}} - when it is shown.
The question is how to prevent view frame change when Status Bar is being shown or hidden.