Post not yet marked as solved
Click to stop watching this thread.
You have stopped watching this post. Click to start watching again.
contentPostList.repliesup-voted.tooltip
I had the same problem and my workaround was to replace the NavigationLink in the "trailing: " with a Button that triggered a State variable to show a .hidden NavigationLink.Example:struct ContentView: View {
@EnvironmentObject var dataStore : DataStore
@State private var showingInvite : Bool = (DataStore.shared().vehicles.count == 0)
@State private var showVehicles : Bool = false
var body: some View {
NavigationView {
VStack {
MasterView()
NavigationLink(destination: VehiclesView(currentCar: self.$dataStore.currentLog), isActive: self.$showingInvite) {
Text("Add Vehicle")
}.hidden()
MenuView()
}
.navigationBarItems(
trailing: Button(action: {self.showingInvite = true},
label: { if DataStore.shared().vehicles.count > 0 {
Text(DataStore.shared().vehicles[self.dataStore.currentLog] )
} else {
Text("Add")
}
})
)
}
}
}