Created
September 24, 2021 18:32
-
-
Save dmytro-anokhin/ccf1a327222fbbfa6ebb77c8b2a0a102 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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