GithubHelp home page GithubHelp logo

jonathantribouharet / jtnumberscrollanimatedview Goto Github PK

View Code? Open in Web Editor NEW
208.0 11.0 39.0 57 KB

A scroll animation for display number for iOS

License: MIT License

Objective-C 60.33% Ruby 10.49% C 3.29% Shell 25.90%
ios animation numbers

jtnumberscrollanimatedview's Introduction

JTNumberScrollAnimatedView

CI Status Version License Platform

Use JTNumberScrollAnimatedView for have a nice animation for display number. It's easy to use, easy to customize.

Installation

With CocoaPods, add this line to your Podfile.

pod 'JTNumberScrollAnimatedView', '~> 1.0'

Screenshots

Example

Usage

Basic usage

You can use JTNumberScrollAnimatedView like a normal view.

#import <UIKit/UIKit.h>

#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.

- (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

License

JTNumberScrollAnimatedView is released under the MIT license. See the LICENSE file for more info.

jtnumberscrollanimatedview's People

Contributors

helloyako avatar jonathantribouharet avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

jtnumberscrollanimatedview's Issues

How to limit the count of characters scrolling

Hi, I'm Vincent. I just know here is a very useful framework you did.
After testing, I'm confused about how to limit the count of characters scrolling.
For example , if now is "3456" and next number is "3489" , how to only scroll last two columns bus not scroll all?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.