'Unable to present. Please file a bug.' with multiple NavigationLinks
This is a known issue but the workaround of adding an empty NavigationLink
didn’t work for me.
On my Mac app when I have multiple NavigationLinks I get Unable to present. Please file a bug.
when I tap on more than one.
My hacky solution is to create a NavigationButton
that replaces the NavigationLink
struct NavigationButton<Destination>: View where Destination: View {
let text: String
let destination: Destination
@State var showing = false
init(_ text: String, destination: Destination) {
self.text = text
self.destination = destination
}
var body: some View {
ZStack {
if showing {
NavigationLink(text, destination: destination, isActive: $showing)
.opacity(0)
}
Button(text) {
showing = true
}
}
}
}