|
I'm using a NavigationSplitView with two columns (SidebarView and ContentView) and a detail view that is a TabView. I want each of the tab views (here, Bingo and Bongo) to have different toolbars but I'm tying myself in knots. Currently I can present a toolbar for the first tab but it doesn't change when the second tab is selected. Even if it did correctly change the toolbar I wouldn't be happy adding the toolbar inside the NavigationSplitView (as happens right now) since I'd have problems executing the button methods properly for each of the intended tab views. Has anyone faced this kind of problem? I know that nesting NavigationViews isn't the way forward so I'm steering clear of that but I'm at the hair pulling stage of debugging.
|
|
Hi. I just refactored your code to use enums instead of strings. Seems like now it works without a hitch.
|
|
|
|
The issue was here
you indicated tag to be optional. If you change them to String this will work as expected as well. |
TAKE YOUR SKILLS TO THE NEXT LEVEL If you like Hacking with Swift, you'll love Hacking with Swift+ – it's my premium service where you can learn advanced Swift and SwiftUI, functional programming, algorithms, and more. Plus it comes with stacks of benefits, including monthly live streams, downloadable projects, a 20% discount on all books, and free gifts!
Sponsor Hacking with Swift and reach the world's largest Swift community!
You need to create an account or log in to reply.
All interactions here are governed by our code of conduct.
Link copied to your pasteboard.