I'm trying to get a NavigationLink
to trigger when a string is no longer nil. Is there anyway to do this or something similar?
NavigationLink(destination: MainView(), isActive: $settings.isLoggedS !=nil)
Any help is greatly appreciated!
You can program the link.
@State var activeString : String = ""
var body: some View {
NavigationView{
NavigationLink(destination: Text(""), isActive: Binding<Bool>(get: {self.activeString != ""}, set: { _ in
}) ){
TextField("input", text: $activeString)}}}