Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Demo code of building token button in SwiftUI
struct TokenButton {
var buttonLabel: TokenButtonLabel
var buttonStyle: TokenButtonStyle
// Circle Button
private var circleBtnType: CircleBtnType! = .primary
private var circleBtnIcon: String! = "circle-plus"
init(circleButtonType: CircleBtnType, buttonIcon: String) {
// --snip--
}
// Icon Button
private var iconBtnType: IconBtnType! = .action
private var iconBtnIcon: String! = "upload"
/// Icon Button
init(iconButtonType: IconBtnType = .tool, buttonIcon: String) {
// --snip--
}
// Capsule Button
private var capsuleBtnText: String! = "Save"
init(capsuleText: String) {
// --snip--
}
// Text Button
private var textBtnText: String! = "select"
init(buttonText: String) {
// --snip--
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.