WWBankBalanceAnimationLabel

- UILabel text animation.
- UILabel文字动画.

dependencies: [
.package(url: "https://github.com/William-Weng/WWBankBalanceAnimationLabel.git", .upToNextMajor(from: "1.0.0"))
]
函数 |
说明 |
balance(from:to:duration:fps:format:runloop:forMode:progress:completion:) |
执行数字动画 |
import UIKit
import WWPrint
import WWBankBalanceAnimationLabel
final class ViewController: UIViewController {
@IBOutlet weak var label1: WWBankBalanceAnimationLabel!
@IBOutlet weak var label2: WWBankBalanceAnimationLabel!
@IBOutlet weak var label3: WWBankBalanceAnimationLabel!
override func viewDidLoad() {
super.viewDidLoad()
}
@IBAction func running(_ sender: UIBarButtonItem) {
label1.balance(from: 0, to: 100_000_000, format: "TWD. %.0f") { value in
wwPrint(value)
} completion: { isCompletion in
wwPrint(isCompletion)
}
label2.balance(to: 123456.56789, duration: 3.0, format: "CNY. %.5f", runloop: .current, forMode: .common)
label3.balance(to: 200_000_000, duration: 5.0, fps: 5, format: "USD. %.1f")
}
}