CodeInserterView 0.1.1

CodeInserterView 0.1.1

Arthur Giachini 维护。



  • Arthur Giachini

CodeInserterView

Version License Platform

描述

CodeInserterView是一个动态代码输入器,可以由1到8位字段组成。它具有自动跳转到下一个字段和自动返回前一个字段的功能。它可以用于验证码类型的输入。

功能

在本gif示例中,有_four位字段的CodeInserterView。在您的代码中,您可以设置为ONE到EIGHT之间。

使用

它通过视图编码使用。

不要忘记将translatesAutoresizingMaskIntoConstraints变量修改为false

为CodeInserterView设置相应的约束,将其添加到视图中,就可以了!

控制CodeInserterView

  • shouldReturnDigit默认为YES,当按下退格键时会返回到前一个文本字段。
  • func allDigitsTextfieldsFilled() 如果所有数字字段都已填写,则返回 YES

安装

CodeInserterView 可通过 CocoaPods 获取。安装方法仅需将以下行添加到您的 Podfile

pod 'CodeInserterView'

完成操作后,确保运行 "pod install"。

就是这样!只需导入模块并使用。

作者

Arthur Giachini,[email protected]

许可协议

CodeInserterView 在 MIT 许可协议下提供。有关更多信息,请参阅 LICENSE 文件。