Skip to content

Instantly share code, notes, and snippets.

@kwylez
Created April 30, 2020 03:01
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kwylez/08c64d36394898f5808da0f947f6c891 to your computer and use it in GitHub Desktop.
Save kwylez/08c64d36394898f5808da0f947f6c891 to your computer and use it in GitHub Desktop.
/// works
struct QuickChatView: View {
var body: some View {
ZStack {
VStack {
HStack {
Button(action: {
print("Delete button tapped!")
}) {
Image(systemName: "xmark.circle")
.font(.title)
.padding()
.background(Color.red)
.clipShape(Circle())
.foregroundColor(.white)
}
}
.padding(.trailing)
.padding(.top, 24.0)
Text("Hello, World!")
.onTapGesture {
print("what the hell")
}
Spacer()
}
}
}
}
/// fails
struct QuickChatView: View {
var body: some View {
ZStack {
VStack {
HStack {
Spacer()
Button(action: {
print("Delete button tapped!")
}) {
Image(systemName: "xmark.circle")
.font(.title)
.padding()
.background(Color.red)
.clipShape(Circle())
.foregroundColor(.white)
}
}
.padding(.trailing)
.padding(.top, 24.0)
Text("Hello, World!")
.onTapGesture {
print("what the hell")
}
Spacer()
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment