ABCounterViewController 0.4.0

ABCounterViewController 0.4.0

测试已测试
Lang语言 Obj-CObjective C
许可证 MIT
并发行上次发布2015年5月

Alan Bouzek维护。



简介

一个最小的计数器控件,具有增加和减少功能。它包括设置起始值、最大值和最小值以及文本属性的能力。

示例

alt tag

用法

要运行示例项目,请克隆仓库,然后从示例目录中首先运行 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
  • numberTextAttributes 和 buttonTextAttributes 是标准的文本属性 NSDictionaries。
  • startCount 确定起始数字,minCount 和 maxCount 确定计数器可以达到的最小和最大数字。
  • stepInterval 是增加和减少的间隔。

每当计数更新时,都会调用代理方法

-(void) counterViewController:(ABCounterViewController *)counterViewController
             didUpdateToCount:(float)count

将在此处调用。

初始化后必须手动设置框架,宽度和高度至少为两倍时看起来最好。

安装

作者

abouzek,[email protected]

许可证

ABCounterViewController 在 MIT 许可证下可用。有关更多信息,请参阅 LICENSE 文件。