Skip to content

Instantly share code, notes, and snippets.

@dmytro-anokhin
Created September 24, 2021 18:32
Show Gist options
  • Save dmytro-anokhin/ccf1a327222fbbfa6ebb77c8b2a0a102 to your computer and use it in GitHub Desktop.
Save dmytro-anokhin/ccf1a327222fbbfa6ebb77c8b2a0a102 to your computer and use it in GitHub Desktop.
struct ContentView: View {
private var suggestions = ["Amstelveen", "Amsterdam", "Amsterdam-Zuidoost", "Amstetten"]
@State var input: String = ""
var body: some View {
VStack {
TextField("", text: $input)
.textFieldStyle(.roundedBorder)
.padding()
}
List(suggestions, id: \.self) { suggestion in
ZStack {
Text(suggestion)
}
.frame(maxWidth: .infinity, maxHeight: .infinity, alignment: .leading)
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment