PKAutofillTextField 1.0.2

PKAutofillTextField 1.0.2

Praveen Kumar Shrivastav维护。



PKAutofillTextField

CI Status Version License Platform

特性

  • 通过仅创建实例并将其添加到视图即可轻松集成
  • 使用独特的标识符保持所有输入
  • 不手动输入,只需在初始化时设置,即可存储默认值
  • 具有删除记录的能力

Screenshot

安装

CocoaPods

PKAutofillTextField可通过CocoaPods获取。要安装它,只需将以下行添加到您的Podfile中

pod 'PKAutofillTextField'

手动

复制包含两个Swift文件的整个PKSecurePin文件夹,并将其添加到您的项目中

cp -rf PKAutofillTextField/Classes/ <to_your_project_dir>

用法

		// import the PKAutofillTextField
		import PKAutofillTextField

		class 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 目录运行 pod install

作者

Praveen Kumar Shrivastav,[email protected]

许可协议

PKAutofillTextField 在 MIT 许可证下可用。有关更多信息,请参阅 LICENSE 文件。