Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

iOS Swift autocomplete dropdown with also own keywords

I'm looking for a way to create a textfield with autocomplete and dropdown feature so that a user can also add a new keyword.

Similar to this JS-selector:

https://select2.github.io/examples.html#tags

dropdown own key

dropdown autocomplete

The only difference is that my textfield should only accept one selection and no multiselect.

I've googled for open source or a payed widget for this, but mostly I found very old and not good looking stuff with Swift 1 and things like that.

So is there no fancy autocomplete-dropdown textfield which is simple to implement in my project?

Or is there a reason why there is so less stuff on a UI-object like the one I described?

like image 697
Kingalione Avatar asked Mar 13 '23 00:03

Kingalione


1 Answers

There is no auto-complete widget, that I'm aware of at least.

But you can create your own:

  1. pull the string from the input textfield.
  2. compare it against an array of potential keywords
  3. pull the range of the string, highlight the letters in the keywords
  4. where the user completes without selecting a drop down, add keyword
like image 81
Johnny Rockex Avatar answered Mar 16 '23 00:03

Johnny Rockex