一个最小的计数器控件,具有增加和减少功能。它包括设置起始值、最大值和最小值以及文本属性的能力。
要运行示例项目,请克隆仓库,然后从示例目录中首先运行 pod install
。
应使用指定的初始化器创建 ABCounterViewController 的实例
-(instancetype) initWithDelegate:(id<ABCounterViewController)delegate
startCount:(float)startCount
minCount:(float)minCount
maxCount:(float)maxCount
stepInterval:(float)stepInterval
numberTextAttributes:(NSDictionary *)numberTextAttributes
buttonTextAttributes:(NSDictionary *)buttonTextAttributes
每当计数更新时,都会调用代理方法
-(void) counterViewController:(ABCounterViewController *)counterViewController
didUpdateToCount:(float)count
将在此处调用。
初始化后必须手动设置框架,宽度和高度至少为两倍时看起来最好。
abouzek,[email protected]
ABCounterViewController 在 MIT 许可证下可用。有关更多信息,请参阅 LICENSE 文件。