GeneralFormatter
功能
您可以在文本字段上应用以下遮罩
- BOLETO
- BOLETO & CONVENIOS
- CEP
- CONVENIOS
- CPF
- CPF & CNPJ
- CNPJ
- PHONE
示例
要运行示例项目,首先克隆仓库,然后在 Example 目录中运行 pod install
安装
GeneralFormatter 通过 CocoaPods 提供。要安装它,只需将以下行添加到您的 Podfile 中
pod "GeneralFormatter"
用法
在UITextFieldDelegate中直接链接
import GeneralFormatter
func textField(_ textField: UITextField, shouldChangeCharactersIn range: NSRange, replacementString string: String) -> Bool {
return GeneralFormatter.cpf.formatTextField(_: textField, shouldChangeCharactersIn: range, replacementString: string)
}
作者
Luis Filipe Campani, [电子邮箱 protected] Uriel Battanoli, [电子邮箱 protected]
许可
GeneralFormatter遵守MIT许可协议。有关更多信息,请参阅LICENSE文件。