TestsTested | ✗ |
LangLanguage | Obj-CObjective C |
License | MIT |
ReleasedLast Release | Apr 2017 |
Maintained by wangyan.
一款使用CoreAnimation实现动画数字变动效果
WYCountingLabel
整个文件夹拖入项目即可格式化Label
__weak typeof(self) weakSelf = self;
WYCountingLabel plusLabel = [[WYCountingLabel alloc] initWithFrame:CGRectMake(20, 100, 100, 30)];
[self.view addSubview:plusLabel];
[plusLabel setWy_FormatBlock:^NSString *(double wy_number) {
NSString *str = [NSString stringWithFormat:@"%.2f元", wy_number];
return str;
}];
plusLabel.wy_number += 10;
从一个数到另一个数的动画
WYCountingLabel plusLabel = [[WYCountingLabel alloc] initWithFrame:CGRectMake(20, 100, 100, 30)];
[self.view addSubview:plusLabel];
[plusLabel countFrom:0 to:1576 duration:2.0];
wangyansnow, [email protected]
WYCountingLabelDemo is available under the MIT license. See the LICENSE file for more info.