In my AppDelegate.swift I check if the user is signed in or not
if let currentUser = Auth.auth().currentUser{
self.window?.rootViewController = self.storyboard?.instantiateViewController(withIdentifier: "HomeScreen")
}else{
self.window?.rootViewController = self.storyboard?.instantiateViewController(withIdentifier: "LoginScreen")
}
If the user is not logged they get redirected to LoginScreen and there they can login, I then present HomeScreen as follows
UIApplication.shared.keyWindow?.window?.rootViewController = self.storyboard?.instantiateViewController(withIdentifier: "HomeScreen")
My HomeScreen is a NavigationController that will redirect to a ViewController, there I add my view as follows:
UIApplication.shared.keyWindow?.addSubview(newView!)
When my app runs directly to my HomeScreen from the AppDelegate newView will display above my StatusBar, like it should. If the HomeScreen is displayed after a user login from the LoginScreen, newView will be displayed behind the statusBar.
What can be the problem that makes my view display below the status bar in the second scenario?
EDIT: I might also add that the newView is a swipe gesture to show it.