Post

Replies

Boosts

Views

Activity

SwiftUI NavigationLink in List with subviews
Hello, I have a list in the root view of my app like so: List { NavigationLink(destination: AnimalListView()) { SummaryView() } } And SummaryView is a row of boxes, like so: HStack { VStack { Text("24") Text("Dogs") } VStack { Text("10") Text("Cats") } // etc... } The root view is a count of each animal type. The detail view is a listing of animals, filterable by type. Can I make it so that if the user taps a specific box, it takes them to the detail view with the filter already set for the type in the box they tapped, but if they tap on the row itself, it goes there without the filter set? I can't figure out how to get the type or tap location from the summary view, up into the root view, to trigger a NavigationLink. Thank you
5
0
4.3k
Jan ’21
Can I disable the New Document menu item without losing the Open menu item as well?
Hello all, I have a SwiftUI app which can view some document formats, but not create new ones. I would like to disable the File > New menu item as it is not needed. I see you can use CommandGroup(replacing: .newItem){} to do this, however then I lose both the Open and Open Recent menu items as well. Is it possible to either remove only the New item from the File menu? Or perhaps remove all three then manually add back the Open item? Any advice would be gratefully received. Thank you.
1
2
612
Nov ’21