SearchTextField alternatives and similar libraries
Based on the "TextField & TextView" category.
Alternatively, view SearchTextField alternatives based on common mentions on social networks and blogs.
-
JVFloatLabeledTextField
UITextField subclass with floating labels - inspired by Matt D. Smith's design: http://dribbble.com/shots/1254439--GIF-Mobile-Form-Interaction?list=users -
TextFieldEffects
Custom UITextFields effects inspired by Codrops, built using Swift -
PYSearch
๐ An elegant search controller which replaces the UISearchController for iOS (iPhone & iPad) . -
SkyFloatingLabelTextField
A beautiful and flexible text field control implementation of "Float Label Pattern". Written in Swift. -
Reel Search
:octocat: ๐ RAMReel is a UI controller that allows you to choose options from a list. Swift UI library made by @Ramotion -
StatefulViewController
Placeholder views based on content, loading, error or empty states -
NextGrowingTextView
๐ The next in the generations of 'growing textviews' optimized for iOS 8 and above. -
MLPAutoCompleteTextField
UITextfield subclass with autocomplete menu. For iOS. -
RPFloatingPlaceholders
UITextField and UITextView subclasses with placeholders that change into floating labels when the fields are populated with text. -
InputBarAccessoryView
A simple and easily customizable InputAccessoryView for making powerful input bars with autocomplete and attachments -
GrowingTextView
An UITextView in Swift. Support auto growing, placeholder and length limit. -
AnimatedTextInput
Animated UITextField and UITextView replacement for iOS -
RSKGrowingTextView
A light-weight UITextView subclass that automatically grows and shrinks. -
KMPlaceholderTextView
A UITextView subclass that adds support for multiline placeholder written in Swift. -
UITextField-Shake
UITextField category that adds shake animation -
InstantSearch iOS
โก๏ธ A library of widgets and helpers to build instant-search applications on iOS. -
AutocompleteField
Subclass of UITextField that shows inline suggestions while typing. -
SelectableTextView
A text view that supports selection and expansion -
TweeTextField
Lightweight set of text fields with nice animation and functionality ๐ -
TextFieldCounter
UITextField character counter with lovable UX ๐. No math skills required ๐. -
VMaskTextField
VMaskTextField is a library which create an input mask for iOS. -
UITextField-Navigation
๐โโ๏ธ UITextField-Navigation makes it easier to navigate between UITextFields and UITextViews -
IQDropDownTextField
TextField with DropDown support using UIPickerView -
DTTextField
DTTextField is a custom textfield with floating placeholder and error label -
EmojiTextView
Tap to swap out words with emojis. Inspired by Messages.app on iOS 10. -
PasswordTextField
A custom TextField with a switchable icon which shows or hides the password and enforce good password policies -
CocoaTextField
Apple TextField created according to the Material.IO guidelines of 2019. Featured at Medium. -
ARAutocompleteTextView
ARAutocompleteTextView is a subclass of UITextView that automatically displays text suggestions in real-time. This is perfect for automatically suggesting the domain as a user types an email address, #hashtag or @alexruperez. -
RSKPlaceholderTextView
A light-weight UITextView subclass that adds support for placeholder. -
CHIOTPField
CHIOTPField is a set of textfields that can be used for One-time passwords, SMS codes, PIN codes, etc. Mady by @ChiliLabs - https://chililabs.io -
styled-text
Declarative text styles and streamlined Dynamic Type support for iOS -
CBPinEntryView
A customisable view for entering arbitrary length pins, codes or passwords in iOS. Supports iOS 12 one time codes. -
AwesomeTextField
Awesome TextField is a nice and simple libriary for iOS and Mac OSX. It's highly customisable and easy-to-use tool. Works perfectly for any registration or login forms in your app. -
Streamoji
:godmode: Custom emoji rendering library for iOS apps with support for GIF & still images - plug-in extension for UITextView - performance, cache โ - Made with ๐ by @GetStream -
ModernSearchBar
The famous iOS search bar with auto completion feature implemented. -
MBAutoGrowingTextView
An auto-layout base UITextView subclass which automatically grows with user input and can be constrained by maximal and minimal height -
Tagging
A TextView that provides easy to use tagging feature for Mention or Hashtag -
RSFloatInputView
A Float Input View with smooth animation and supporting icon and seperator written with Swift -
MVAutocompletePlaceSearchTextField
iOS - Subclass of UITextField to achieve autocompletion for Place Search like Google Places, Uber and Much more apps having maps. -
SRKControls
A Custom control which turns UITextfield to item-picker & date-picker. -
PLCurrencyTextField
UITextField that support currency in the right way. -
AutoCompleteTextField
TextField with smart suggestion -
CurrencyTextField
UITextField that automatically formats text to display in the currency format -
NxEnabled
Library that allows you binding `enabled` property of button with textable elements (TextView, TextField) -
MeasurementTextField
UITextField-based control for (NS)Measurement values input.
Appwrite - The Open Source Firebase alternative introduces iOS support
* Code Quality Rankings and insights are calculated and provided by Lumnify.
They vary from L1 to L5 with "L5" being the highest.
Do you think we are missing an alternative of SearchTextField or a related project?
README
SearchTextField
Overview
SearchTextField is a subclass of UITextField, written in Swift that makes really easy the ability to show an autocomplete suggestions list.
You can decide wether to show the list as soon as the field is focused or when the user starts typing.
You can also detects when the user stops typing, very useful when you can get a suggestion list from a remote server.
New Feature! Now you can make suggestions "inline", showing the first matched result as the placeholder (instead of the results list) and selecting it when the user touches the enter key.
Requirements
- iOS 9
Installation
SearchTextField is available through CocoaPods. To install it, simply add the following line to your Podfile:
use_frameworks!
pod "SearchTextField"
Manual installation
Just import SearchTextField.swift into your project
Usage
You can use it in the simplest way...
import SearchTextField
// Connect your IBOutlet...
@IBOutlet weak var mySearchTextField: SearchTextField!
// ...or create it manually
let mySearchTextField = SearchTextField(frame: CGRectMake(10, 100, 200, 40))
// Set the array of strings you want to suggest
mySearchTextField.filterStrings(["Red", "Blue", "Yellow"])
...or you can customize it as you want
// Show also a subtitle and an image for each suggestion:
let item1 = SearchTextFieldItem(title: "Blue", subtitle: "Color", image: UIImage(named: "icon_blue"))
let item2 = SearchTextFieldItem(title: "Red", subtitle: "Color", image: UIImage(named: "icon_red"))
let item3 = SearchTextFieldItem(title: "Yellow", subtitle: "Color", image: UIImage(named: "icon_yellow"))
mySearchTextField.filterItems([item1, item2, item3])
// Set a visual theme (SearchTextFieldTheme). By default it's the light theme
mySearchTextField.theme = SearchTextFieldTheme.darkTheme()
// Modify current theme properties
mySearchTextField.theme.font = UIFont.systemFontOfSize(12)
mySearchTextField.theme.bgColor = UIColor (red: 0.9, green: 0.9, blue: 0.9, alpha: 0.3)
mySearchTextField.theme.borderColor = UIColor (red: 0.9, green: 0.9, blue: 0.9, alpha: 1)
mySearchTextField.theme.separatorColor = UIColor (red: 0.9, green: 0.9, blue: 0.9, alpha: 0.5)
mySearchTextField.theme.cellHeight = 50
// Set specific comparision options - Default: .caseInsensitive
mySearchTextField.comparisonOptions = [.caseInsensitive]
// Set the max number of results. By default it's not limited
mySearchTextField.maxNumberOfResults = 5
// You can also limit the max height of the results list
mySearchTextField.maxResultsListHeight = 200
// Customize the way it highlights the search string. By default it bolds the string
mySearchTextField.highlightAttributes = [NSBackgroundColorAttributeName: UIColor.yellowColor(), NSFontAttributeName:UIFont.boldSystemFontOfSize(12)]
// Handle what happens when the user picks an item. By default the title is set to the text field
mySearchTextField.itemSelectionHandler = {item, itemPosition in
mySearchTextField.text = item.title
}
// You can force the results list to support RTL languages - Default: false
mySearchTextField.forceRightToLeft = true
// Show the list of results as soon as the user makes focus - Default: false
mySearchTextField.startVisible = true
// ...or show the list of results even without user's interaction as soon as created - Default: false
mySearchTextField.startVisibleWithoutInteraction = true
// Start filtering after an specific number of characters - Default: 0
mySearchTextField.minCharactersNumberToStartFiltering = 3
// Force to show the results list without filtering (but highlighting)
mySearchTextField.forceNoFiltering = true
// Explicitly hide the results list
mySearchTextField.hideResultsList()
/**
* Update data source when the user stops typing.
* It's useful when you want to retrieve results from a remote server while typing
* (but only when the user stops doing it)
**/
mySearchTextField.userStoppedTypingHandler = {
if let criteria = self.mySearchTextField.text {
if criteria.characters.count > 1 {
// Show the loading indicator
self.mySearchTextField.showLoadingIndicator()
self.searchMoreItemsInBackground(criteria) { results in
// Set new items to filter
self.mySearchTextField.filterItems(results)
// Hide loading indicator
self.mySearchTextField.stopLoadingIndicator()
}
}
}
}
// Handle item selection - Default behaviour: item title set to the text field
mySearchTextField.itemSelectionHandler = { filteredResults, itemPosition in
// Just in case you need the item position
let item = filteredResults[itemPosition]
print("Item at position \(itemPosition): \(item.title)")
// Do whatever you want with the picked item
self.mySearchTextField.text = item.title
}
// Define a results list header - Default: nothing
let header = UILabel(frame: CGRect(x: 0, y: 0, width: acronymTextField.frame.width, height: 30))
header.backgroundColor = UIColor.lightGray.withAlphaComponent(0.3)
header.textAlignment = .center
header.font = UIFont.systemFont(ofSize: 14)
header.text = "Pick your option"
mySearchTextField.resultsListHeader = header
New feature: show the first matched result as placeholder (inline mode)
// Set the array of strings you want to suggest
mySearchTextField.filterStrings(["Red", "Blue", "Yellow"])
// Then set the inline mode in true
mySearchTextField.inlineMode = true
New feature: autocomplete from, for example, a list of email domains
emailInlineTextField.inlineMode = true
emailInlineTextField.startFilteringAfter = "@"
emailInlineTextField.startSuggestingInmediately = true
emailInlineTextField.filterStrings(["gmail.com", "yahoo.com", "yahoo.com.ar"])
Swift Versions
Swift 5 supported from 1.2.3 version.
Swift 4 supported from 1.2.0 version.
Install v1.0.0 if you need to support Swift 2.3.
Install v1.0.2 and above if you want to support Swift 3.
Demo
Check out the Example project.
Author
Alejandro Pasccon, [email protected]
License
SearchTextField is available under the MIT license. See the LICENSE file for more info.
*Note that all licence references and agreements mentioned in the SearchTextField README section above
are relevant to that project's source code only.