SubmitButton
An animated Submit Button written in Swift.
Install / Use
/learn @yangyin5127/SubmitButtonREADME
SubmitButton
An animated Submit Button written in Swift.

##Installation
just drag SubmitButton.swift to your project.
How to use
1 create a button
- 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) porperties to change button settings
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) button stateChanged callback
btn1.stateChanged = {
(toState:SubmitButtonState) in
if toState == .Loading {
self.btn1.progress = 1
}
}
4 changing button state
@IBAction func btnClicked(_ sender: AnyObject) {
let btn = sender as! SubmitButton
if btn.submitState != .Normal {
btn.changeState(.Normal)
} else {
btn.changeState(.Loading)
}
}
5 setting progress
...
btn.progress = 1
...
Requirements
- swift3 +
- xcode8 +
Related Skills
node-connect
347.2kDiagnose OpenClaw node connection and pairing failures for Android, iOS, and macOS companion apps
frontend-design
108.0kCreate distinctive, production-grade frontend interfaces with high design quality. Use this skill when the user asks to build web components, pages, or applications. Generates creative, polished code that avoids generic AI aesthetics.
openai-whisper-api
347.2kTranscribe audio via OpenAI Audio Transcriptions API (Whisper).
qqbot-media
347.2kQQBot 富媒体收发能力。使用 <qqmedia> 标签,系统根据文件扩展名自动识别类型(图片/语音/视频/文件)。
