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

  • 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? – Wo_0NDeR ᵀᴹ Dec 11 '22 at 13:24
  • i solved... in my last viewController navigationbar has settled hidden... – ibrahim erdogan Dec 11 '22 at 14:20

0 Answers0