AnimatedTextFieldCounter
示例
要运行示例项目,请克隆仓库,然后首先从Example目录运行pod install
。
功能
要求
- 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)
故事板支持。
使用代理
导入AnimatedTextFieldCounter类
import AnimatedTextFieldCounter
将委托添加到您的类中
class ViewController: UIViewController, AnimatedTextFieldCounterDelegate
然后设置委托
textField.counterDelegate = self
然后使用reachedMaxLimit方法。
func reachedMaxLimit(textfield: AnimatedTextFieldCounter) {
print("hey!")
}
作者
Azat Goktas, [email protected]
许可
AnimatedTextFieldCounter遵守MIT许可。请参阅LICENSE文件以获取更多信息。