Hi all,
I am unsure as to why my print statements aren't being shown in the output section when I run a simulation ?
Please could you have a look at my code and explain ?
import SwiftUI
struct ContentView: View { @State var dateIdentifier : String = "" @State var lastSelectedIdentifier : String = "" var body: some View { NavigationView { VStack { Button(action: { dateIdentifier.append("a"); lastSelectedIdentifier.append("a"); print(dateIdentifier);
}) {
NavigationLink(destination: Text("OutPut")) {
Rectangle()
.frame(width: 100, height: 100)
}
}
Button(action: {
dateIdentifier.append("b");
lastSelectedIdentifier.append("b");
print(dateIdentifier);
}) {
NavigationLink(destination: Text("OutPut")) {
Rectangle()
.frame(width: 100, height: 100)
}
}
Button(action: {
dateIdentifier.append("c");
lastSelectedIdentifier.append("c");
print(dateIdentifier);
}) {
NavigationLink(destination: Text("OutPut")) {
Rectangle()
.frame(width: 100, height: 100)
}
}
}
}
}
}
Thank you
Connor