https://github.com/pvn/pkautofilltextfield
Smart textfield which holds existing inputs. For e.g You do not want to enter the server address again by typing rather than selecting from existing input lists which was entered.
https://github.com/pvn/pkautofilltextfield
Last synced: 6 months ago
JSON representation
Smart textfield which holds existing inputs. For e.g You do not want to enter the server address again by typing rather than selecting from existing input lists which was entered.
- Host: GitHub
- URL: https://github.com/pvn/pkautofilltextfield
- Owner: pvn
- License: mit
- Created: 2018-09-18T20:35:45.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2018-09-27T22:54:39.000Z (over 6 years ago)
- Last Synced: 2024-11-18T04:53:30.473Z (6 months ago)
- Language: Swift
- Homepage:
- Size: 2.46 MB
- Stars: 7
- Watchers: 4
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# PKAutofillTextField
[](https://travis-ci.org/pvn/PKAutofillTextField)
[](https://cocoapods.org/pods/PKAutofillTextField)
[](https://cocoapods.org/pods/PKAutofillTextField)
[](https://cocoapods.org/pods/PKAutofillTextField)**Feature:**
* Ease to integrate by just creating instance and add to view
* Holds all inputs w.r.t. their unique identifier
* Store default values without giving input manually, just set those values while intializing
* Ability to delete records
## Installation
### CocoaPods
PKAutofillTextField is available through [CocoaPods](https://cocoapods.org). To install
it, simply add the following line to your Podfile:```ruby
pod 'PKAutofillTextField'
```### Manual
Copy the entire `PKSecurePin` folder which contains two swift files and add to your project
```
cp -rf PKAutofillTextField/Classes/
```## Usage
```swift// import the PKAutofillTextField
import PKAutofillTextFieldclass ViewController: UIViewController, PKAutofillTextFieldDelegate {
override func viewDidLoad() {
// instantiate PKAutofillTextField
// presenting: self
// keyIdentifier: unique identifier for textfield
// buttonTitle: to show the button title on textfield
let textField = PKAutofillTextField.init(frame: CGRect.init(x: 5, y: 400, width: 400, height: 50), presenting: self, keyIdentifier: "server", delegate: self, buttonTitle: "show")
// some default values for textfield
textField.defaultValues(values: ["https://google.com", "https://weather.com"])
// add textfield to view
self.view.addSubview(textField)
}// callback methods of PKAutofillTextFieldDelegate
func selectedValue(value: String) {
//implementation goes here after selecting the value from lists
}
}
```## Example
To run the example project, clone the repo, and run `pod install` from the Example directory first.
## Author
Praveen Kumar Shrivastav, [email protected]
## License
PKAutofillTextField is available under the MIT license. See the LICENSE file for more info.