问题
For example, when I input several letters, the corresponding words will show up automatically and then I can select them. But how to implement this kind of function? Which kind of UI element should I use ? Should I also input all countries in the world in cord data so that I can get the corresponding results ?
回答1:
The image you've shown appears to be simply a UITableView that appears and is populated in response to what the user types in a UITextField.
回答2:
If you're working with a table view similar to your screen shot, you can use a UISearchController
. Here's a tutorial about it.
来源:https://stackoverflow.com/questions/35678224/how-to-implement-keywords-associated-function-in-swift