I have a navigation controller, where its root view controller is a logIn View controller, when the user login, it calls present(..) to display a different screen, but I have something special on the display. As the picture shows, it shows the layers between two screens. I am not able to remove such behavior. My app is without storyboard.
code:
func scene(_ scene: UIScene, willConnectTo session: UISceneSession, options connectionOptions: UIScene.ConnectionOptions) {
naviVC = UINavigationController()
naviVC?.viewControllers = [loginVc!]
guard let windowScene = (scene as? UIWindowScene) else { return }
window = UIWindow(frame: UIScreen.main.bounds)
window?.rootViewController = naviVC
window?.makeKeyAndVisible()
window?.windowScene = windowScene
}
Later when I calls this at loginVC:
//nextVC is the next viewController here.
self.present(self.nextVC, animated: false, completion: nil)
Output as the picture shows: See the top, the green is the loginVC, the white is the nextVC
How can I fix it, so the nextVC will cover the LoginVC?
Any help is greatly appreciated!