JBTextField
技巧与贴士
-
如果需要显示标题,请使用
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'
作者
许可
JBTextField 在MIT许可下可用。更多信息请参阅LICENSE文件。