CHAnimationLabel
示例
要运行示例项目,请先克隆仓库,然后从 Example 目录中运行 pod install
。
要求
安装
CHAnimationLabel 通过 CocoaPods 提供。要安装它,只需将以下行添加到您的 Podfile 中:
pod 'CHAnimationLabel'
使用
动画类型 < .缓动
let label = CHAnimationLabel(frame: CGRect(x: 33, y: 66, width: 333, height: 133))
label.animationType = .typewriter
///label.animationType = .shine
///label.animationType = .count
label.text = "This is a label with animation effects"
label.textColor = .black
view.addSubview(label)
label.startAnimation(duration: 2, nil)
动画类型 >= .缓动
let label = CHAnimationLabel(frame: CGRect(x: 33, y: 66, width: 333, height: 133))
label.animationType = .easeInOut
///label.animationType = .easeIn
///...
label.text = "This is a label with animation effects"
label.textColor = .black
view.addSubview(label)
label.startCounterAnimation(frome: 0, to: 10000, with: 2) {
debugPrint("do something")
}
作者
杨胜浩, [email protected]
许可协议
CHAnimationLabel 在MIT许可证下可用。更多信息请参阅LICENSE文件。