I wonder how can I share @Namespace between views to create a fluid animations between NavigationView transitions by using new matchedGeometryEffect modifier.
Post
Replies
Boosts
Views
Activity
Hello,
I use sheet modifier to display a modal view. I also use new Toolbar API to provide a few actions. I notice that items with destructiveAction and cancellationAction placement doesn't appear. confirmationAction works as expected.
import SwiftUI
struct ContentView: View {
@State private var showingAlert = false
var body: some View {
Button("Show modal") {
showingAlert = true
}.sheet(isPresented: $showingAlert) {
NavigationView {
Modal()
}
}
}
}
struct Modal: View {
var body: some View {
Text("Modal")
.toolbar {
ToolbarItem(placement: .confirmationAction) {
Button("Confirm") {}
}
ToolbarItem(placement: .cancellationAction) {
Button("Cancel") {}
}
ToolbarItem(placement: .destructiveAction) {
Button("Delete") {}
}
}
}
}