在线时间:8:00-16:00
迪恩网络APP
随时随地掌握行业动态
扫描二维码
关注迪恩网络微信公众号
开源软件名称:EasyCountDownButton开源软件地址:https://gitee.com/EasySwift/EasyCountDownButton开源软件介绍:EasyCountDownButton一个超级好用的倒计时Button Join Us为了更好的完善EasySwift框架,希望更多对此框架有兴趣的朋友一起加入进来打造最好用最全面扩展最好的swift框架。EasySwift官方QQ群:542916901 Mark先更新Github上的项目,所以最新的项目一定在Github上。 Features
ScreenShotSystem RequirementsiOS 8.0 or above InstallationAs a CocoaPods DependencyAdd the following to your Podfile: pod 'EasyCountDownButton' VersionV0.0.1 ---- 2016-8-10
Exampleimport UIKitimport EasyCountDownButtonclass ViewController: UIViewController { let btn = EasyCountDownButton(frame: CGRect(x: 100, y: 100, width: 100, height: 30)) override func viewDidLoad() { super.viewDidLoad() btn.disableConfig = EasyCountDownButtonConfig( font: UIFont.systemFontOfSize(14), title: "剩余 5 秒", titleColor: UIColor.grayColor(), backgroundColor: UIColor.groupTableViewBackgroundColor(), backgroundImage: nil) btn.enableConfig = EasyCountDownButtonConfig( font: UIFont.systemFontOfSize(14), title: "获取验证码", titleColor: UIColor.magentaColor(), backgroundColor: UIColor.blueColor(), backgroundImage: nil) self.view.addSubview(btn) // 点击事件 button type要 设置成custom 否则会闪动 btn.addToucheHandler { (btn, second) in btn.startWithSecond(5) } // 时间改变 btn.didChange { (btn, second) -> String! in return "剩余 \(second) 秒" } // 时间结束 btn.didFinished { (btn, second) in print(btn) print(second) } // 手动停止// btn.stop() } override func didReceiveMemoryWarning() { super.didReceiveMemoryWarning() }} 极致框架
LicenseEasyEmoji is licensed under the Apache License, Version 2.0 License. For more information, please see the LICENSE file. |
请发表评论