Skip to content

Instantly share code, notes, and snippets.

@christianselig
Created March 30, 2022 16:15
Show Gist options
  • Select an option

  • Save christianselig/be0d8dd490984d65c8714fe9abe7115b to your computer and use it in GitHub Desktop.

Select an option

Save christianselig/be0d8dd490984d65c8714fe9abe7115b to your computer and use it in GitHub Desktop.
Another silly SwiftUI question for late March!
struct ContentView: View {
var body: some View {
Button {
print("Someone poked me!")
} label: {
HStack {
Text("POKE ME")
Spacer()
Text("DO IT")
}
}
.buttonStyle(MyButtonStyle())
.frame(width: 200.0)
.background(Color.blue.opacity(0.25))
}
}
struct MyButtonStyle: ButtonStyle {
func makeBody(configuration: Configuration) -> some View {
// Just an empty style
configuration.label
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment