Latest 1.0.2
Homepage https://github.com/michaelin1208/MMNumberScrollView
License MIT
Platforms ios 9.0, requires ARC
Frameworks UIKit
Authors

MMNumberScrollView used to show number scroll animation

In last project, I develop a number scroll view to show number increasing animations. Now I try to pick it out to share in my GitHub
MMNumberScrollView

Demo Snapshot

DemoSnapshot

Cocoapods

Install Cocoapods if need be.

$ gem install cocoapods

Add MMNumberScrollView in your Podfile.

use_frameworks!
pod 'MMNumberScrollView'

Then, run the following command.

$ pod install

Introduction

In this view, you can customize the number images array, the scrolling speed and the frame size of this view whether it is dynamically resizing during number increasing.

In the next update, I might update the view to support number decreasing animation.

#import <UIKit/UIKit.h>
#import "MMSingleNumberScrollView.h"

@class MMNumberScrollViewManager;

@protocol MMNumberScrollViewManagerDelegate <NSObject>

- (void)numberScrollViewManagerFinishedIncreasing:(MMNumberScrollViewManager *)manager;     // delegate method is callbacked when the number scroll view manager finish a increasing operation.

@end

@interface MMNumberScrollViewManager:UIView <UIScrollViewDelegate, MMSingleNumberScrollViewDelegate>

@property (nonatomic,strong) NSMutableArray *numImageArray;  // a mutable array of number images shown in number scroll view.
@property (nonatomic) NSTimeInterval speedDuration;  // roll speed, the duration of each increasing scrolling. The default value is 1 second.
@property (nonatomic) BOOL isShowingFinalSize;  // is it show final size at beginning. Default value is 'YES', the size of scroll view is not increasing during scrolling.

@property (nonatomic, weak) id<MMNumberScrollViewManagerDelegate> delegate;

// increase number displayed in the manager's view from currentCount to targetCount.
// You would better to start another increasing after last increasing operation finished (by "- (void)numberScrollViewManagerFinishedIncreasing:(MMNumberScrollViewManager *)manager;")
// or remove all existed number scroll views ("- (void)removeAllNumberScrollViews;").
- (void)increaseNumberFrom:(int)currentCount to:(int)targetCount;

// init the number scroll view manager to contral all single number scroll views.
- (instancetype)initWithFrame:(CGRect)frame;

// remove all single number scroll views, if you want to shwo another number increasing.
- (void)removeAllNumberScrollViews;

@end

Cocoapods实践笔记

此外最近有些迷恋Cocoapods,最近都在尝试如何把自己的工程中自己工程中的三方库交给CocoaPods来管理。今天也顺道实践下怎么创建CocoaPods。方法可以参考下:

创建CocoaPods的制作过程

CocoaPods的安装使用和常见问题

没有遇到什么特别的问题,除了个别步骤需要翻墙,推荐下Lantern,虽然流量有上限,但是从来没超过。创建过程一切顺利,应该成功了,但是暂时在Cocoapods中还搜索不到我的工程。

Latest podspec

{
    "name": "MMNumberScrollView",
    "version": "1.0.2",
    "summary": "MMNumberScrollView is used to show number increasing animation with customized number images and scrolling speed.",
    "description": "MMNumberScrollView is used to show number increasing animation with customized number images, dynamic frame size and scrolling speed.",
    "homepage": "https://github.com/michaelin1208/MMNumberScrollView",
    "license": {
        "type": "MIT",
        "file": "LICENSE"
    },
    "authors": {
        "michaelin1208": "[email protected]"
    },
    "platforms": {
        "ios": "9.0"
    },
    "source": {
        "git": "https://github.com/michaelin1208/MMNumberScrollView.git",
        "tag": "1.0.2"
    },
    "source_files": [
        "MMNumberScrollView",
        "MMNumberScrollView/**/*.{h,m}"
    ],
    "frameworks": "UIKit",
    "requires_arc": true
}

Pin It on Pinterest

Share This