动画TextFieldCounter 0.1.0

AnimatedTextFieldCounter 0.1.0

Azat Goktas 维护。




  • 作者:
  • Azat Göktaş

AnimatedTextFieldCounter

CI Status Version License Platform

示例

要运行示例项目,请克隆仓库,然后首先从Example目录运行pod install

功能

  • 设置UITextfield的最大长度。
  • 易于在Storyboard中自定义
  • Demo

要求

  • iOS 9.0 或更新版本

安装

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

pod 'AnimatedTextFieldCounter'

如何使用?

编程添加

let textField = AnimatedTextFieldCounter(frame: CGRect(x: 40, y: 80, width: 320, height: 30), maxLength: 5, heightOfCounterView: 4, animationDuration: 0.2, shakeCount: 1)

self.view.addSubview(textField)

故事板支持。

  • 从对象库拖放一个UITextField。
  • 转到身份检查器,将类设置为AnimatedTextFieldCounter。
  • 然后返回属性检查器。这里是!
  • Storyboard

使用代理

导入AnimatedTextFieldCounter类

import AnimatedTextFieldCounter

将委托添加到您的类中

class ViewController: UIViewController, AnimatedTextFieldCounterDelegate

然后设置委托

textField.counterDelegate = self

然后使用reachedMaxLimit方法。

func reachedMaxLimit(textfield: AnimatedTextFieldCounter) {
    print("hey!")
}

作者

Azat Goktas, [email protected]

许可

AnimatedTextFieldCounter遵守MIT许可。请参阅LICENSE文件以获取更多信息。