KKDCountDown 1.0.0

KKDCountDown 1.0.0

Kadir Kemal Dursun 维护。




KKDCountDown

CI Status Version License Platform


KKDCountDown 是简单的圆形倒计时。您可以轻松配置圆形设计。KKDCountDown 使用 mach_absolute_time 函数精确测量持续时间。

屏幕截图

安装

KKDCountDown 通过 CocoaPods 来使用。要安装它,只需将以下行添加到您的 Podfile 中

pod 'KKDCountDown'

使用

参数

circleWidth

它是圆的线宽。默认值是15。

circleColor

它是圆的颜色。默认值是UIColor.gray。

progressColor

它是圆的颜色。默认值是UIColor.red。

textColor

它是文字的颜色。默认值是UIColor.red。

textFont

它是文字的字体。默认值是UIFont.systemFont(ofSize: 36)

默认文本

这是默认文本。默认值是""

文字眨眼句子

这是默认文本。此值应在0到1之间。默认值是0.2

开始倒计时

使用startCountDown函数来启动

        circularCountDown.startCountDown(10) {
            let alert = UIAlertController(title: "Time is up", message: "", preferredStyle: .alert)
            let cancel = UIAlertAction(title: "Cancel", style: .destructive, handler: { (action) -> Void in })
            alert.addAction(cancel)
            self.present(alert, animated: true)
        }

停止倒计时

使用stopCountDown函数停止

        circularCountDown.stopCountDown();

暂停倒计时

使用stopCountDown函数停止

        circularCountDown.pauseCountDown();

恢复倒计时

使用stopCountDown函数停止

        circularCountDown.resumeCountDown();

精确测量

KKDCountDown使用mach_absolute_time()函数来精确测量持续时间。

作者

卡迪尔·凯马尔·杜桑,《https://github.com/KadirKemal

许可协议

KKDCountDown遵循MIT许可协议。更多信息请查阅LICENSE文件。