info.plist
<key>UIViewControllerBasedStatusBarAppearance</key>
<true/>
UIViewController
override var prefersStatusBarHidden: Bool{
return true
}
when i use 6p ,it's ok
but
iphoneX ,it's can't call and StatusBar not hidden
info.plist
<key>UIViewControllerBasedStatusBarAppearance</key>
<true/>
UIViewController
override var prefersStatusBarHidden: Bool{
return true
}
when i use 6p ,it's ok
but
iphoneX ,it's can't call and StatusBar not hidden
You need to check if your view controller is included in a container (i.e. UINavigationController). If that is the case, the full procedure is this:
1) Set the View
controller-based status bar appearance
value in info.plist file to YES2) In your child controller add this code:
3) Add this extension:
You already have point 1 and 2. Same logic applies to UITabBarController