UPGRADE YOUR SKILLS: Learn advanced Swift and SwiftUI on Hacking with Swift+! >>

Building a complete project - TabView - I'm not sure it's working correctly.

Forums > SwiftUI

@Mary  

Hello,

I've been working through Paul's Building a complete project tutorial where we build a menu app that features a tabview at the bottom.

The tutorial can be found here:

https://www.hackingwithswift.com/quick-start/swiftui/swiftui-tutorial-building-a-complete-project

The app opens to a "Menu" which is a segmented list of menu items. You can click on one of the items and that will open a detailed view of that item that includes a button for adding that item to the order. The two-item TabView - Menu and Order - sits underneath everything.

The issue I'm having is with the TabView navigation. Say you are on the list view of the menu and then click on an individual item and, from there, click on the "Order" tab on the Tabview, it takes you to the Order view and that makes sense. But if you then click on the Menu" tab, it takes you back to the detailed view of the item you originally clicked on rather than taking you to the list view of the menu.

I have an illustration that might make easier to see what's going on that I was going to insert here...but I don't have anywhere to upload it for a URL. Sorry about that.

That seems wrong. But maybe that's just the way it is. I'm guessing that the app thinks of a detail view reached through the list view as still part of that list view?

And if that's the case, is there a way to override the this and make the Menu tab always take the user back to the list view of the menu?

Thanks!

3      

Hacking with Swift is sponsored by Essential Developer

SPONSORED Join a FREE crash course for mid/senior iOS devs who want to achieve an expert level of technical and practical skills – it’s the fast track to being a complete senior developer! Hurry up because it'll be available only until April 28th.

Click to save your free spot now

Sponsor Hacking with Swift and reach the world's largest Swift community!

Archived topic

This topic has been closed due to inactivity, so you can't reply. Please create a new topic if you need to.

All interactions here are governed by our code of conduct.

 
Unknown user

You are not logged in

Log in or create account
 

Link copied to your pasteboard.