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 }

source share