In my rootViewController i have hidden status bar. When i tried to push the new viewcontroller and pop back, then navigation bar is pushed up and there is the gap between navigation bar and content view. Here are the screenshot of navigation bars.
Here is the code in rootViewController
override func viewWillAppear(_ animated: Bool) {
super.viewWillAppear(animated)
self.statusBarHidden = true
self.navigationController?.setNavigationBarHidden(true, animated: true)
}
private var statusBarHidden = true {
didSet {
self.setNeedsStatusBarAppearanceUpdate()
}
}
override var prefersStatusBarHidden: Bool {
get {
return statusBarHidden
}
}