Skip to content

Instantly share code, notes, and snippets.

@pabloblancog
Last active September 17, 2020 12:28
Styling - Button styles palette
enum ButtonStylePalette: ButtonStyle {
case primary
case secondary
case destructive
func makeBody(configuration: Configuration) -> some View {
switch self {
case .primary:
return AnyView(PrimaryButtonStyle(color: ColorsPalette.primary.color)
.makeBody(configuration: configuration))
case .secondary:
// Return button styled view for secondary case
case .destructive:
// Return button styled view for destructive case
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment