https://github.com/javalnanda/NumericAnimatedLabel
Animate numeric value while setting new value to label
https://github.com/javalnanda/NumericAnimatedLabel
Last synced: 6 months ago
JSON representation
Animate numeric value while setting new value to label
- Host: GitHub
- URL: https://github.com/javalnanda/NumericAnimatedLabel
- Owner: javalnanda
- License: mit
- Created: 2017-05-25T05:23:13.000Z (almost 8 years ago)
- Default Branch: master
- Last Pushed: 2017-05-25T11:48:50.000Z (almost 8 years ago)
- Last Synced: 2024-05-29T04:52:13.165Z (12 months ago)
- Language: Shell
- Size: 368 KB
- Stars: 26
- Watchers: 4
- Forks: 3
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-ios - NumericAnimatedLabel - Swift UIView for showing numeric label with incremental and decremental step animation while changing value. Useful for scenarios like displaying currency. (UI / Label)
README
# NumericAnimatedLabel
[](https://travis-ci.org/javalnanda/NumericAnimatedLabel)
[](http://cocoapods.org/pods/NumericAnimatedLabel)
[](http://cocoapods.org/pods/NumericAnimatedLabel)
[](http://cocoapods.org/pods/NumericAnimatedLabel)
[](https://twitter.com/javalnanda)
## Example
To run the example project, clone the repo, and run `pod install` from the Example directory first.
## Requirements
## Installation
NumericAnimatedLabel is available through [CocoaPods](http://cocoapods.org). To install
it, simply add the following line to your Podfile:```ruby
pod "NumericAnimatedLabel"
```## Setup
The only thing you need to do is import `NumericAnimatedLabel`, add a UIView to storyboard and create an outlet of it.
```swift
import NumericAnimatedLabel
```
```swift
@IBOutlet weak var numericLabel: NumericAnimatedLabel!
``````swift
override func viewDidLoad() {
super.viewDidLoad()
// Set Value
numericLabel.setValue(v: walletBalance)// Customize if required
numericLabel.textAlignment = .center
numericLabel.formatString = "%.2f"
numericLabel.textFont = UIFont.boldSystemFont(ofSize: 20.0)
// Text color can be changed from storyboard inspector or programmatically also.
}
```
## Suggestions or feedback?Feel free to create a pull request, open an issue or find me [on Twitter](https://twitter.com/javalnanda).
## Author
javalnanda, [email protected]
## License
NumericAnimatedLabel is available under the MIT license. See the LICENSE file for more info.