0

I was following a tutorial for making a side menu which I want to implement into my home menu screen. The thing is I am having trouble presenting the side menu controller within only the home menu and not from the root view controller which is the Log in.

I tried working with the scene delegate:

    guard let windowScene = (scene as? UIWindowScene) else { return }

    window?.windowScene = windowScene
    window = UIWindow(frame: UIScreen.main.bounds)
    if let window = window {
        var vc = LogInController()

        if Auth.auth().currentUser?.uid != nil{
             let vc = HomeMenu()
        }

        let nav = UINavigationController()
        let mainView = vc
        nav.viewControllers = [mainView]
        window.rootViewController = nav
        window.makeKeyAndVisible()
    }

I am using Firebase for the log in functions. I am new to xcode and using navigation so any help in which I can access the side menu only in the home menu after logging in would help. Thank you.

Frank van Puffelen
  • 565,676
  • 79
  • 828
  • 807

1 Answers1

0

To add a side menu to your app, i recommend using this pod which gives you almost a full control over the menu , also inside the documentation it shows you how you can implement a button (action) in order to show or hide the side menu so for your needs you can add the pod and implement the control button (show menu action) only where you want the user to be able to see the menu, (homeVC) in your case . Pod link and documentation below:

https://cocoapods.org/pods/SideMenu

If you don't know how to use pods inside your app you can refer to their get started tutorial (https://guides.cocoapods.org/using/getting-started.html) in order to get more familiar using it which you will use a lot later on .