diff --git a/StepMap/ContentView.swift b/StepMap/ContentView.swift index 1e0afed..9710d94 100644 --- a/StepMap/ContentView.swift +++ b/StepMap/ContentView.swift @@ -19,6 +19,9 @@ struct ContentView: View { // TODO: create a map // Add navigation to the map + // after you click the navigation button, show the start and end place on the map with a tag or whatever it's called + // add "cancel" button that will hide the route + // add ability to hold on the map to place a mark (end goal) // Display the calculated distance and how long will it take by walking // Get walkingStepLength from HealthKit // Show how many steps does the route take diff --git a/StepMap/SearchView.swift b/StepMap/SearchView.swift index 45dc286..5eadeb7 100644 --- a/StepMap/SearchView.swift +++ b/StepMap/SearchView.swift @@ -21,12 +21,26 @@ struct SearchView: View { TextField("Search for any location", text: $query) .autocorrectionDisabled() .onChange(of: self.query) { - search(for: self.query) + if query.count > 0 { + search(for: self.query) + } else { + self.locations = [] + } } .onAppear { // TODO: delete this, it's for debug only search(for: self.query) } + .overlay { + HStack{ + Spacer() + Image(systemName: "multiply.circle.fill") + .foregroundStyle(.gray) + .onTapGesture { + query = "" + } + } + } } .modifier(TextFieldGrayBackgroudColor()) Spacer()