Can anyone help me? I simply want to print to the console a variable from a picker, where do I place the print statement? I want to print the changing variable in the picker. thank you
@State var selectedWeek: TimeSpan = .two
var body: some View {
NavigationView {
VStack {
MyMapView()
.edgesIgnoringSafeArea(.all)
Picker("Time Span", selection: $selectedWeek) {
ForEach(TimeSpan.allCases) { weekSelected in
Text(weekSelected.name).tag(weekSelected)
}
}.pickerStyle(SegmentedPickerStyle())
.background(Color.gray)
.padding()
}.navigationBarTitle(Text("Contact Tracing"), displayMode: .inline)
} }
}