TextFieldsCatalog 0.17.0

TextFieldsCatalog 0.17.0

chausovSurfStudioAlexander Chausov维护。



  • Alexander Chausov

TextFieldsCatalog

GitHubActions Build Status Documentation Version Platform License Swift Version codebeat badge

概览

该仓库包含各种输入字段的集合,提供了丰富的验证输入值和格式化输入文本的功能。此外,它们看起来很漂亮,并且易于定制 :)

完整文档 - 可在GitHub Pages上找到

安装

Cocoapods

只需将以下行添加到您的Podfile中

pod 'TextFieldsCatalog'

第一步指南

假设您需要实现一个用户名输入字段,其长度应在5到25个字符之间,且您对于内置的UnderlinedTextField设计满意。

您需要完成以下步骤

  • 在Podfile中加入pod 'TextFieldsCatalog',执行pod install,打开.workspace
  • 在屏幕上加入UIView,将其类改为UnderlinedTextField,设置其高度为77
  • 在ViewController中为此字段添加IBOutlet,例如命名为textField
  • 配置输入字段
textField.configure(placeholder: "Имя", maxLength: 25)
textField.configure(autocapitalizationType: .words)
textField.validator = TextFieldValidator(minLength: 5, maxLength: 25, regex: nil)

以上步骤足以完成输入字段的基本配置。如需更多信息,请查看Example项目,并阅读文档

仓库结构

实际上,仓库包括自带的pod,以及一个完整的Example项目,可以立即在项目中测试新的或现有的字段。

文档

测试项目的文档

字段目录项目的文档

字段输入功能文档

许可证

TextFieldsCatalog遵循MIT 许可证