测试已测试 | ✗ |
语言语言 | SwiftSwift |
许可 | MIT |
发布最后发布 | 2017年10月 |
SwiftSwift版本 | 3.0 |
SPM支持SPM | ✗ |
由 Leonardo Cardoso 维护。
为乏味的UITextField添加揭示按钮的简单扩展
如果您不愿使用上述任何依赖管理器,可以将RevealTextField手动集成到项目中。
您可以通过调用函数 revealable()
在任何 UITextField
上使用 RevealTextField
。是的,这是一个 扩展,而不是一个 子类
let passwordTextField = UITextField()
passwordTextField.isSecureTextEntry = true
passwordTextField.revealable() // <<---
passwordTextField.revealable(secureImage: UIImage?, // <<--- isSecureTextEntry == true.
unsecureImage: UIImage?, // <<--- isSecureTextEntry == false.
tintColor: UIColor?, // <<--- image color, default is black.
dimension: CGFloat?) // <<--- image dimension, default is 30.
revealable()
将您的乏味的 UITextField
转换为 揭示 的 UITextField
。toggleReveal()
会在任何时间自动切换揭示。这对每个 UITextField
都有效。toggleImage(_ isSecure: Bool)
会在任何时间切换揭示图像。RevealTextField在MIT许可下发布。有关详细信息,请参阅许可。