| Number of watchers on Github | 651 |
| Number of open issues | 6 |
| Main language | Swift |
| Open pull requests | 5+ |
| Closed pull requests | 0+ |
| Last commit | over 3 years ago |
| Repo Created | over 3 years ago |
| Repo Last Updated | over 1 year ago |
| Size | 17 KB |
| Homepage | http://iosdev.io/... |
| Organization / Author | filipstefansson |
| Latest Release | 1.1 |
| Contributors | 1 |
| Page Updated | 2018-03-12 |
| Do you use AutocompleteField? Leave a review! | |
| View open issues (6) | |
| View AutocompleteField activity | |
| View on github | |
| Fresh, new opensource launches 🚀🚀🚀 | |
|
Trendy new open source projects in your inbox!
View examples
|
|

AutocompleteField let's you add word completion to your UITextFields.
Autocomplete, or word completion, is a feature in which an application predicts the rest of a word a user is typing.

Import AutocompleteField.swift into your project.
platform :ios, '8.0'
pod "AutocompleteField", "~> 1.1"
The easiest way is to add a UITextField in your Storyboard, and then giving it the AutocompleteField subclass. You can use the property editor to change both the padding and the completion color of the textfield.
If you want to add a field using code, there's a custom init method you can use:
import AutocompleteField
let textField = AutocompleteField(frame: CGRectMake(10, 10, 200, 40), suggestions: ["Abraham", "George", "Franklin"])
view.addSubview(textField)
AutocompleteField is a subclass of UITextField, so you can modify it in the same way you normally would, without any restrictions. The new properties you can set are:
| Property | Type | Description |
|---|---|---|
padding |
CGFloat |
Left/right padding. |
completionColor |
UIColor |
The color of the suggestion. Defaults to the default placeholder color. |
suggestion |
String |
The current suggestion shown. Can be used to force a suggestion. |
suggestions |
[String] |
Array of suggestions. |
autocompleteType |
AutocompleteType |
The type of autocomplete that should be used. .Word will only hint the the next word in the suggestion and .Sentence will show all words. |
pixelCorrection |
CGFloat |
Move the suggestion label up or down. Sometimes there's a small difference, and this can be used to fix it. |
Check out the Example project.
AutocompleteField is provided under the MIT License. See LICENSE for details.