filipstefansson / Autocompletefield
Licence: mit
Subclass of UITextField that shows inline suggestions while typing.
Stars: ✭ 656
Programming Languages
swift
15916 projects
Projects that are alternatives of or similar to Autocompletefield
TextInputLayout
The objective of this code is to guide you to create login screen with TextInputLayout in iOS app.
Stars: ✭ 30 (-95.43%)
Mutual labels: input, uitextfield, textfield
Underlinetextfield
Simple UITextfield Subclass with state
Stars: ✭ 156 (-76.22%)
Mutual labels: input, textfield, uitextfield
react-native-element-textinput
A react-native TextInput, TagsInput and AutoComplete component easy to customize for both iOS and Android.
Stars: ✭ 28 (-95.73%)
Mutual labels: autocomplete, input, textfield
VPAutoComplete
A simple Auto Complete UITextField also support UITableView written in swift 4.2
Stars: ✭ 20 (-96.95%)
Mutual labels: autocomplete, textfield
React Native Autocomplete Input
Pure javascript autocomplete input for react-native
Stars: ✭ 615 (-6.25%)
Mutual labels: autocomplete, input
Vue Cool Select
Select with autocomplete, slots, bootstrap and material design themes.
Stars: ✭ 195 (-70.27%)
Mutual labels: autocomplete, input
Core Components
Accessible and lightweight Javascript components
Stars: ✭ 85 (-87.04%)
Mutual labels: autocomplete, input
Autocomplete
jQuery like auto complete for iOS UITextField
Stars: ✭ 36 (-94.51%)
Mutual labels: autocomplete, uitextfield
rich input
Rich input box, implement @Someone and subject with color highlighting
Stars: ✭ 58 (-91.16%)
Mutual labels: input, textfield
Inputkit
📝InputKit, an Elegant Kit to limits your input text, inspired by BlocksKit, written in both Objective-C & ⚡️Swift.
Stars: ✭ 420 (-35.98%)
Mutual labels: input, textfield
CurrencyText
Currency text field formatter available for UIKit and SwiftUI 💶✏️
Stars: ✭ 124 (-81.1%)
Mutual labels: uitextfield, textfield
Alerts And Pickers
Advanced usage of UIAlertController and pickers based on it: Telegram, Contacts, Location, PhotoLibrary, Country, Phone Code, Currency, Date...
Stars: ✭ 5,267 (+702.9%)
Mutual labels: textfield, uitextfield
React Selectrix
A beautiful, materialized and flexible React Select control
Stars: ✭ 166 (-74.7%)
Mutual labels: autocomplete, input
Vue Places
Places component is based on places.js for Vue 2.x. Turn any <input> into an address autocomplete.
Stars: ✭ 106 (-83.84%)
Mutual labels: autocomplete, input
paper-chip
A chip web component made with Polymer 2 following Material Design guidelines
Stars: ✭ 30 (-95.43%)
Mutual labels: autocomplete, input
React Input Enhancements
Set of enhancements for input control
Stars: ✭ 1,375 (+109.6%)
Mutual labels: autocomplete, input
Textfieldcounter
UITextField character counter with lovable UX 💖. No math skills required 🙃.
Stars: ✭ 424 (-35.37%)
Mutual labels: textfield, uitextfield
Searchtextfield
UITextField subclass with autocompletion suggestions list
Stars: ✭ 980 (+49.39%)
Mutual labels: autocomplete, uitextfield
V Suggest
A Vue2 plugin for input content suggestions, support using keyboard to navigate and quick pick, it make use experience like search engine input element
Stars: ✭ 67 (-89.79%)
Mutual labels: autocomplete, input
LycricsTextView
No description or website provided.
Stars: ✭ 14 (-97.87%)
Mutual labels: uitextfield, textfield
AutocompleteField
Subclass of UITextField
that shows inline suggestions while typing.
- Plug and play replacement for
UITextField
. - Delimiter support. Perfect when autocompleting email addresses.
- Two suggestion modes (word and sentence, see API below).
- Works with custom fonts, borders etc.
- Super lightweight and zero dependencies.
Requirements
- iOS 10.0+
- Swift 4.2+
Installation
CocoaPods
Add the following to your Podfile
:
target 'MyApp' do
pod 'AutocompleteField', '~> 2.0'
end
Swift Package Manager
- Select File > Swift Packages > Add Package Dependency.
- Enter
https://github.com/filipstefansson/AutocompleteField.git
in the Choose Package Repository dialog.
See Apple docs for more information.
Manually
- Copy
/Sources/AutocompleteField.swift
to your project. There are no other dependencies.
Usage
You use this textfield in the same way as the regular UITextField
, through Storyboards or programmatically.
Basic
import AutocompleteField
...
let textfield = AutocompleteField(frame: CGRect(x: 20, y: 20, width: 200, height: 40))
textfield.placeholder = "Name"
textfield.suggestions = [
"George Washington",
"Thomas Jefferson",
"John Adams",
"Theodore Roosevelt",
"John F. Kennedy",
"George W. Bush",
]
self.view.addSubview(textfield)
Delimiter
The delimiter can be used to only suggest an autocompletion after a specific character is found in the string. In this example we look for the @
character, and then provide suggestions for email providers.
import AutocompleteField
...
// email textfield autocompleting email providers
let textfield = AutocompleteField(frame: CGRect(x: 20, y: 20, width: 200, height: 40))
textfield.placeholder = "Email"
textfield.keyboardType = .emailAddress
textfield.suggestions = [
"gmail.com",
"icloud.com",
"outlook.com",
]
// add the delimiter
textfield.delimiter = "@"
self.view.addSubview(textfield)
API
Property | Type | Description |
---|---|---|
suggestionColor |
UIColor |
The color of the suggestion. Defaults to the default placeholder color. |
suggestion |
String |
The current suggestion shown. Read only. |
suggestions |
[String] |
Array of suggestions. |
suggestionType |
SuggestionType |
The type of suggestion that should be used. .Word will only hint the the next word in the suggestion and .Sentence will show the whole suggestion. Defaults to .Sentence . |
pixelCorrections |
CGPoint |
Move the suggestion label up/down left/right. Use this to correct any differences if the suggestion doesn't match the input value for some reason. |
horizontalPadding |
CGFloat |
Add padding to your textfield. Automatically set when using a borderStyle that has padding. |
delimiter |
String |
Add a delimiter to only show a suggestion if there's more than one occurance of the delimiter. Perfect for autocompleting email providers. |
Demo
Check out the example project.
License
AutocompleteField
is provided under the MIT License. See LICENSE for details.
Note that the project description data, including the texts, logos, images, and/or trademarks,
for each open source project belongs to its rightful owner.
If you wish to add or remove any projects, please contact us at [email protected].