I have a problem in iOS11 with the iPhoneX simulator.
I have a viewcontroller without the statusbar. To do this I add:
- (BOOL)prefersStatusBarHidden {
return YES;
}
It is good so far but the navigationbar overlaps the safearea in the iPhoneX.
How can I fix this?
Finally the solution was using safeAreaInsets
if (@available(iOS 11.0, *)) {
UIEdgeInsets safeInsets = UIApplication.sharedApplication.delegate.window.safeAreaInsets;
paddingTop = safeInsets.top;
}
You can do this programatically or using autolayout