Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/johnvuko/jtnumberscrollanimatedview
A scroll animation for display number for iOS
https://github.com/johnvuko/jtnumberscrollanimatedview
animation ios numbers
Last synced: about 2 months ago
JSON representation
A scroll animation for display number for iOS
- Host: GitHub
- URL: https://github.com/johnvuko/jtnumberscrollanimatedview
- Owner: johnvuko
- License: mit
- Created: 2014-11-16T01:31:36.000Z (about 10 years ago)
- Default Branch: master
- Last Pushed: 2021-02-23T08:53:54.000Z (almost 4 years ago)
- Last Synced: 2024-07-22T10:48:16.925Z (6 months ago)
- Topics: animation, ios, numbers
- Language: Objective-C
- Size: 55.7 KB
- Stars: 207
- Watchers: 11
- Forks: 39
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# JTNumberScrollAnimatedView
[![CI Status](http://img.shields.io/travis/jonathantribouharet/JTNumberScrollAnimatedView.svg)](https://travis-ci.org/jonathantribouharet/JTNumberScrollAnimatedView)
![Version](https://img.shields.io/cocoapods/v/JTNumberScrollAnimatedView.svg)
![License](https://img.shields.io/cocoapods/l/JTNumberScrollAnimatedView.svg)
![Platform](https://img.shields.io/cocoapods/p/JTNumberScrollAnimatedView.svg)Use JTNumberScrollAnimatedView for have a nice animation for display number.
It's easy to use, easy to customize.## Installation
With [CocoaPods](http://cocoapods.org/), add this line to your Podfile.
pod 'JTNumberScrollAnimatedView', '~> 1.0'
## Screenshots
![Example](./Screens/example.gif "Example View")
## Usage
### Basic usage
You can use `JTNumberScrollAnimatedView` like a normal view.
```objective-c
#import#import "JTNumberScrollAnimatedView.h"
@interface ViewController : UIViewController
@property (weak, nonatomic) IBOutlet JTNumberScrollAnimatedView *animatedView;
@end
```You just have to call `setValue` with a NSNumber and use `startAnimation` for launch the animation.
```objective-c
- (void)viewDidLoad
{
[super viewDidLoad];
[self.animatedView setValue:@249];
}- (void)viewDidAppear:(BOOL)animated
{
[super viewDidAppear:animated];
[self.animatedView startAnimation];
}
```### WARNING
For now the `value` must be a positive integer.
### Customization
You can easily change some properties of the animation.
Each caracter have its own `column`.- `textColor`
- `font`
- `duration`, default to `1.5`
- `durationOffset`, delay between the end of the animation of each column, default to `0.2`
- `density`, number of characters added by column for the animation, default to `5`
- `minLength`, you can force the minimum count of columns, default to `0`
- `isAscending`, the direction of the scroll, default to `NO`If you change one of this properties, you have to call `setValue` for update the view.
## Requirements
- iOS 7 or higher
- Automatic Reference Counting (ARC)## Author
- [Jonathan Tribouharet](https://github.com/jonathantribouharet) ([@johntribouharet](https://twitter.com/johntribouharet))
## License
JTNumberScrollAnimatedView is released under the MIT license. See the LICENSE file for more info.