I made a simple macOS application with NavigationStack
and few views presented using NavigationLink(value:label:)
. It works really nice, except there is no animation at all. Is it possible to add animations to NavigationStack
in this way? I can't use withAnimation {}
, because it's not how NavigationLink
works.
-
Just curious why would you need animation, it is standard functionality and users would like to see to see the view immediately? Instead you could animate the contents of the detail view– user1046037Dec 2, 2022 at 21:28
Add a comment
|
1 Answer
I didn't find a solution with NavigationStack but
Perhaps the solution to this problem will be the use of a Mac Catalyst.
For example, the following forces a stack-based navigation style, overriding the default double-column style on Mac Catalyst:
struct ExampleView: View {
var body: some View {
NavigationView {
NavigationLink("Hello Bananas", destination: Text("🍌🍌"))
}
.navigationViewStyle(StackNavigationViewStyle())
}
}
I would be grateful if there is another solution