0

my problem is somewhere in my app I want to redirect my root navigation view but I didn't.

in my scene delegate

 func scene(_ scene: UIScene, willConnectTo session: UISceneSession, options connectionOptions: UIScene.ConnectionOptions) {
        guard let windowScene = (scene as? UIWindowScene) else { return }
        window = UIWindow(frame: windowScene.coordinateSpace.bounds)
        window?.windowScene = windowScene
        window?.rootViewController = UINavigationController(rootViewController: ViewController())
        window?.makeKeyAndVisible()
        
       

    }

when I want to redirect my rootViewController I used

self.navigationController?.popToRootViewController(animated: true)

but didn't work.

this code redirect me just my ViewController. there is no navigation bar, navigation bar buttons ect.

can anyone help me ?

i have tried everything in this link

there is no solution for me.

i want to add some pictures about my code:

here is my sceneDelegate enter image description here

here is my go to root function

enter image description here

i want to see this screen after the go root function enter image description here

however I see this...

enter image description here

2
  • I'm not able to help because I don't know how is your ui designed. For example, the app main entry point is just a UINavigationController?, but you are trying to pop to where ?, if you only have a simple UIViewController inside UINavigationController? Commented Dec 11, 2022 at 13:24
  • i solved... in my last viewController navigationbar has settled hidden... Commented Dec 11, 2022 at 14:20

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.