I am now making a UITextField with AutoComplete that users will get a place name and zip code list after they have tapped one or some letters.
I got an Autocomplelt (https://github.com/cjcoax/Autocomplete) and there is a delegate function:
func autoCompleteItemsForSearchTerm(term: String) -> [AutocompletableOption]
I have to send a http request with term
to server and wait for a json response as return
.
For network connenction, I used Moya lib and its Method like:
CredentialProvider.request(.Autocomplete(term, 10)) { (result) -> () in }
Now, my question is: How can I make a return value after getting the response from server?
Thanks