iOS 动画提交按钮组件 SubmitButton
- 授权协议: MIT
- 开发语言: Swift
- 操作系统: iOS
- 软件首页: https://github.com/feiin/SubmitButton
- 软件文档: https://github.com/feiin/SubmitButton/blob/master/README.md
软件介绍
SubmitButton 是一组iOS 动画提交按钮,采用Swift开发。
效果图:
使用环境:
swift2 +
xcode7.3 +
使用:
1 创建一个按钮
using code
let frame = CGRect(x: 50, y: 100, width: 200, height: 60)
button = SubmitButton(frame: frame)
button.setTitle("Submit", forState: .Normal)
self.view.addSubview(button)using Storyboard or XIB
2 (Optional) 按钮属性设置
btn.checkLineWidth = 6.0 btn.progressBorderWidth = 5.0 btn.successColor = UIColor(red:0, green:206/255, blue:148/255, alpha:1) btn.progressColor = UIColor(red:0, green:206/255, blue:148/255, alpha:1)
3 (Optional) 按钮statechanged回调
btn1.stateChanged = {
(toState:SubmitButtonState) in
if toState == .Loading { self.btn1.progress = 1
}
}4 改变按钮状态
@IBAction func btnClicked(sender: AnyObject) { let btn = sender as! SubmitButton if btn.submitState != .Normal {
btn.changeState(.Normal)
} else {
btn.changeState(.Loading)
}
}5 设置进度
... btn.progress = 1 ...
Cracking the Coding Interview
Gayle Laakmann McDowell / CareerCup / 2015-7-1 / USD 39.95
Cracking the Coding Interview, 6th Edition is here to help you through this process, teaching you what you need to know and enabling you to perform at your very best. I've coached and interviewed hund......一起来看看 《Cracking the Coding Interview》 这本书的介绍吧!
