Multipoint auto-fill text box in Apple iOS using Swift

So far, I could have performed the auto-complete function in the Textfield user interface in Xcode 6 for my iOS application, but my task is to make some tags and then show a sentence for each of them. For instance:

Enter “Ja” and it will display “Java” in the list, I will select this, type “,” and make it a tag, then I will start typing “PH” and it will display “PHP” and I will choose that and put another "," and so on. Just like jQuery Auto-complete for multiple tags. Is there any way to do this in iOS?

JQuery AutoComplete Plugin Link

+6
source share
1 answer

Use the WSTagField by whitesmith library

Since you finished the autocomplete logic. You just need to show the results in a UITableView. Then use the WSTagField as shown below to show / hide the view of the proposal table.

 let tagsField = WSTagsField() // Events tagsField.onDidAddTag = { field, tag in //Remove suggestions tableview from the view print("DidAddTag", tag.text) } tagsField.onDidChangeText = { _, text in //Add suggestions table to the view } tagsField.onDidChangeHeightTo = { _, height in //Update suggestions table frame to prevent tag field covering } tagsField.onValidateTag = { tag, tags in // validate tag here to match your tags list } 

enter image description here

0
source

Source: https://habr.com/ru/post/977281/


All Articles