Navigation Bar Disappears

Hi all!
I’m trying to create a to-do list type app, and I want to have a navigation bar so that the user can create, go back, save, etc. However, when I run the project in the simulator, all I can see is the table view and not the navigation bar. Does anyone know how to fix this?
I’ve already tried quitting and reopening XCode.

UPDATE: I have a navigation controller before this one that I created so I can have the authenticated login/sign up. I programmed it so that after the user would login/sign up, they would be taken to the list. Long story short, the navigation controller for the login/sign up appears first. However, when I check the box to make the to do list navigation controller come up first (meaning the user doesn’t login/sign up), then the navigation bar shows up for the list. Is there a way to fix this? I want to be able to have the navigation bar be available even after signing in/signing up.

Can you provide a screen capture of your storyboard showing the login/signup ViewController with it’s associated NavigationController.

What code are you specifying to instantiate the ToDoList View Controller?

Yeah. Here is the screenshot of the ViewController and storyboard for the set up for the login/sign up

I used the code from Chris’ video, but instead of having the “Welcome” screen, I changed it so that the user sees the to do list screen. Here is the code for the transition:

And then this is part of the code for the main To do list screen (The one that goes from login/sign up to the list)

Hi Stella,

Where you instantiate your ListViewController after sign up or login, you need to make the rootViewController as a UINavigatioController by using the code:

let listViewController = … as you have specified and then

view.window?.rootViewController = UINavigationController(rootViewController: listViewContoller!)

You would need to do that from both SignUp and Login.

In your storyboard where you have the NavigationController linked to the ListViewContoller can you show me a screenshot of the expanded NavigationController and the ListViewController document outline like the image below (which is from my version of the Code With Chris customLogin Demo App)



Hi Crispy!
Thank you so much for your help. I tested the code out and it worked!
Here’s the screenshot for the expanded NavigationController and ListViewController. As a heads up, the NavigationController above the Navigation Controller that’s expanded is for the login/sign up and not part of the list.

UPDATE: I finished coding the part where the user can add and delete events. However, I think it’s only saving to the device and not the user’s account in Firebase. Is there a specific code that I should use to have the data save to Firebase (such as under a collection or document)?

Hi Stella,

I wasn’t aware that you added another reply to this thread and also did not receive any notification that you replied either.

I only picked up that there was a new reply by scanning for “Unread” posts which I don’t normally do. Sorry about that.

Have you solved the issue in the meantime?

Hi Crispy,

Thank you for your help. Unfortunately I haven’t been able to solve the problem. I got the navigation bar to show up, but I realized that the list saves to the device and not on the user’s account. I want to connect the list that the user makes to the user’s account that they sign in with (which is linked to Firebase) and not just save it to the device. Do you know how to fix it so that the list saves to the account?

When you say “the list saves to the device”, are you referring to it appearing in the tableView or do you mean something different?

With regard to saving the user data to Firestore, I would recommend that you follow one of the tutorials that Chris Ching has created which covers creating documents on Firestore. His iOS Database course covers a lot of material that gives you an overall view of how Firestore works. It’s not something that I can explain in a few words here.

Yes, so the list appears in the tableView. It’s viewable on the device once the user enters something.

I watched Chris Ching’s videos on creating, reading, and deleting data on Firestore, but I don’t think it’s quite what I’m looking for. It may be that I’m interpreting the video wrong, but from the video, he inputs specific data by coding it, so the user isn’t the one adding, reading, and deleting data. However, I want to allow the user to enter data (let’s say in a text box) and it saves to Firestore so that they can access the same data under their account (which is currently a document under a collection called “users”) when signing in on a different device. I guess to simplify that, I want the user to be able to add things to their to-do list, and instead of saving directly to their device, it saves as data in Firestore as a sub document/collection, except I don’t know how.

Would I achieve that by coding quotation marks (like “label” : " ") instead of typing out a specific name (like “label” : “Peller Estates”)?