RevealTextField 1.0.3

RevealTextField 1.0.3

测试已测试
语言语言 SwiftSwift
许可 MIT
发布最后发布2017年10月
SwiftSwift版本3.0
SPM支持SPM

Leonardo Cardoso 维护。



RevealTextField

iOS



为乏味的UITextField添加揭示按钮的简单扩展

要求

  • iOS 8.0+
  • Swift 3.0+
  • Xcode 8.0+

安装

手动

如果您不愿使用上述任何依赖管理器,可以将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许可下发布。有关详细信息,请参阅许可