JBTextField 1.1.1

JBTextField 1.1.1

JB 维护。



  • 作者:
  • jbK

JBTextField

CI Status Version License Platform

💎一个 textField,它可以在使用默认 iOS TextField 时解决任何不便。

ezgif com-gif-maker

技巧与贴士

  • 如果需要显示标题,请使用 isTitleOn

    testTextField.isTitleOn = true
  • 如果需要声明标题,请使用 title

     testTextField.title = "Title"
     }
  • 如果需要进行验证检查,请使用 validation

    testTextField.validation = { $0.count == 4 }
  • 如果需要进行验证检查,请使用 errorMessage

    testTextField.errorMessage = "Error!"
  • 如果需要进行验证检查,请使用 validation

    testTextField.validation = { $0.count == 4 }
  • 如果需要切换错误信息对齐方式,请使用 errorMessageAlignment

    testTextField.errorMessageAlignment = .left
  • 如果要在 rightView 设置图片,请使用 rightImage

    testTextField.rightImage = UIImage(named: "flagOfKorea")

安装

JBTextField 通过 CocoaPods 提供。要安装它,只需将以下行添加到 Podfile:

pod 'JBTextField'

如何设置

1. Simply install the pod
2. Set subclass of textfield as 'JBTextField'

作者

孔正培,[email protected]

许可

JBTextField 在MIT许可下可用。更多信息请参阅LICENSE文件。