All Projects → jkpang → Ppcounter

jkpang / Ppcounter

Licence: mit
iOS与macOS中一款优雅的数字/金额增减动效组件

Projects that are alternatives of or similar to Ppcounter

Swifticonfont
Icons fonts for iOS (Font Awesome 5, Iconic, Ionicon, Octicon, Themify, MapIcon, MaterialIcon, Foundation 3, Elegant Icon, Captain Icon)
Stars: ✭ 1,094 (+142.57%)
Mutual labels:  cocoapods, uibutton, uilabel
Loaderbutton
LoaderButton is a very interesting animation loading button.
Stars: ✭ 19 (-95.79%)
Mutual labels:  cocoapods, uibutton
Haptica
Easy Haptic Feedback Generator 📳
Stars: ✭ 587 (+30.16%)
Mutual labels:  cocoapods, uibutton
Transitionbutton
UIButton sublass for loading and transition animation.
Stars: ✭ 1,124 (+149.22%)
Mutual labels:  cocoapods, uibutton
Swiftcocoadsl
An easy way to write iOS UI
Stars: ✭ 103 (-77.16%)
Mutual labels:  uibutton, uilabel
Emspinnerbutton
UIButton sublcass with loading animation
Stars: ✭ 117 (-74.06%)
Mutual labels:  cocoapods, uibutton
Aaviewanimator
AAViewAnimator is a set of animations designed for UIView, UIButton, UIImageView with options in iOS, written in Swift.
Stars: ✭ 33 (-92.68%)
Mutual labels:  cocoapods, uibutton
Dtgradientbutton
Easy way to set gradient background to your buttons.
Stars: ✭ 76 (-83.15%)
Mutual labels:  cocoapods, uibutton
Uilabel Copyable
A simple category to add copy functionality to UILabel.
Stars: ✭ 113 (-74.94%)
Mutual labels:  cocoapods, uilabel
Efautoscrolllabel
A label which can scroll when text length beyond the width of label.
Stars: ✭ 111 (-75.39%)
Mutual labels:  cocoapods, uilabel
Cltypinglabel
iOS UILabel with character by character typing /typewriter animation
Stars: ✭ 192 (-57.43%)
Mutual labels:  cocoapods, uilabel
Closures
Swifty closures for UIKit and Foundation
Stars: ✭ 1,720 (+281.37%)
Mutual labels:  cocoapods, uibutton
Ssspinnerbutton
Forget about typical stereotypic loading, It's time to change. SSSpinnerButton is an elegant button with a diffrent spinner animations.
Stars: ✭ 357 (-20.84%)
Mutual labels:  cocoapods, uibutton
Mylinearlayout
MyLayout is a powerful iOS UI framework implemented by Objective-C. It integrates the functions with Android Layout,iOS AutoLayout,SizeClass, HTML CSS float and flexbox and bootstrap. So you can use LinearLayout,RelativeLayout,FrameLayout,TableLayout,FlowLayout,FloatLayout,PathLayout,GridLayout,LayoutSizeClass to build your App 自动布局 UIView UITab…
Stars: ✭ 4,152 (+820.62%)
Mutual labels:  cocoapods
Animatedcollectionviewlayout
A UICollectionViewLayout subclass that adds custom transitions/animations to the UICollectionView without effecting your existing code.
Stars: ✭ 4,333 (+860.75%)
Mutual labels:  cocoapods
Agimagepickercontroller
Stars: ✭ 424 (-5.99%)
Mutual labels:  cocoapods
Tweetextfield
Lightweight set of text fields with nice animation and functionality. 🚀 Inspired by https://uimovement.com/ui/2524/input-field-help/
Stars: ✭ 421 (-6.65%)
Mutual labels:  cocoapods
Objective Leveldb
An Objective-C database library built over Google's LevelDB
Stars: ✭ 446 (-1.11%)
Mutual labels:  cocoapods
Urweatherview
Show the weather effects onto view written in Swift4.2
Stars: ✭ 439 (-2.66%)
Mutual labels:  cocoapods
Jyradarchart
an iOS open source Radar Chart implementation
Stars: ✭ 419 (-7.1%)
Mutual labels:  cocoapods

iOS与macOS中一款优雅的数字/金额增减动效控件

iPhone Mac

  • 支持iOS/macOS双平台(pods版本v0.5.0起支持)
  • 支持UILable/UIButton/自定义文本 控件的数字加减动画;
  • 支持一般文本属性以及富文本属性的字体显示;
  • 支持四种时间曲线函数动画:由慢到快再到慢、由慢到特别快、由快到慢、匀速;
  • 支持自定义的文本格式,例如:数字格式化千分位显示;
  • 支持CocoaPods导入

新建 PP-iOS学习交流群 : 323408051 有关于PP系列封装的问题和iOS技术可以在此群讨论

简书地址

Requirements 要求

  • iOS 7+
  • macOS 10.10+
  • Xcode 8+

Installation 安装

1.手动安装:

下载DEMO后,将子文件夹PPCounter拖入到项目中, 导入头文件 PPCounter.h 开始使用

2.CocoaPods安装:

first pod 'PPCounter',:git => 'https://github.com/jkpang/PPCounter.git'

then pod install 或 pod install --no-repo-update

如果发现pod search PPCounter 不是最新版本,在终端执行pod setup命令更新本地spec镜像缓存(时间可能有点长),重新搜索就OK了

Usage 使用方法

1. UILabel

1.1 设置一般字体属性UILabel

....
[label pp_fromNumber:0 toNumber:100 duration:1.5 animationOptions:PPCounterAnimationOptionCurveEaseOut format:^NSString *(CGFloat number) {
    // 此处自由拼接内容
    return [NSString stringWithFormat:@"%.2f",number];
} completion:^{
        
    // 完成的回调
}];

1.2 设置富文本字体属性UILabel

....
[label pp_fromNumber:0 toNumber:100 duration:1.5 animationOptions:PPCounterAnimationOptionCurveEaseOut attributedFormat:^NSAttributedString *(CGFloat number) {
        
    // 此处自由设置富文本属性的内容
    NSMutableAttributedString *attributedString = [[NSMutableAttributedString alloc] initWithString:@""];
    return attributedString;
} completion:^{
        
    // 完成的回调
}];

2. UIButton

2.1 设置一般字体属性UIButton

....
[button pp_fromNumber:0 toNumber:100 duration:1.5 animationOptions:PPCounterAnimationOptionCurveEaseOut format:^NSString *(CGFloat number) {
    // 此处自由拼接内容
    return [NSString stringWithFormat:@"%.2f",number];
} completion:^{
        
    // 完成的回调
}];

2.2 设置富文本字体属性UIButton

....
[button pp_fromNumber:0 toNumber:100 duration:1.5 animationOptions:PPCounterAnimationOptionCurveEaseOut attributedFormat:^NSAttributedString *(CGFloat number) {
        
    // 此处自由设置富文本属性的内容
    NSMutableAttributedString *attributedString = [[NSMutableAttributedString alloc] initWithString:@""];
    return attributedString;
} completion:^{
        
    // 完成的回调
}];

以上就是PPCounter的简单使用方法,更详细的用法请看demo

3, macOS Platform 使用

[[PPCounterEngine counterEngine] fromNumber:0
                                   toNumber:999
                                   duration:2.f
                          animationOptions:PPCounterAnimationOptionCurveEaseOut
                              currentNumber:^(CGFloat number) {
        // lable控件
        self.numberLabel.stringValue = [NSString stringWithFormat:@"%ld",(NSInteger)number];
    } completion:^{
    		// 计数完成的回调
        self.numberLabel.textColor = [NSColor redColor];
    }];

你的star是我持续更新的动力!

===

CocoaPods更新日志

  • 2017.03.07(tag:0.6.0)--Mac下的定时器由 NSTimer --> dispatch_source_t;
  • 2017.03.07(tag:0.5.0)--支持iOS/MacOS双平台;
  • 2017.01.07(tag:0.2.0)--优化代码命名规范;
  • 2016.10.23(tag:0.1.1)--优化代码结构与调用API方法;
  • 2016.10.19(tag:0.1.0)--初始化到CocoaPods;

我的App <-> My APP

  • PPHub:一个简洁漂亮的 GitHub iOS客户端 <-> A simple and beautiful GitHub iOS client
    App_Store

联系方式:

PP-iOS学习交流群群二维码

许可证

PPCounter 使用 MIT 许可证,详情见 LICENSE 文件。

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].