Skip to content

Instantly share code, notes, and snippets.

@mchirico
Created October 16, 2020 16:41
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 mchirico/208f0c8f0bfe729f95f29e2a7e664701 to your computer and use it in GitHub Desktop.
Save mchirico/208f0c8f0bfe729f95f29e2a7e664701 to your computer and use it in GitHub Desktop.
import SwiftUI
struct ContentView: View {
@State var count: Int = 0
@State var txt: String = ""
var body: some View {
VStack {
Label(self.txt, systemImage: /*@START_MENU_TOKEN@*/"42.circle"/*@END_MENU_TOKEN@*/)
HStack {
Button(action: {
self.count = self.count + 1
self.txt = "here: \(self.count)"
print("here: \(self.count)")
}) {
Text("Botton Hello")
}
Text("Hello Zoe")
.font(.headline)
.foregroundColor(Color.blue)
.padding()
}
}
}
}
struct ContentView_Previews: PreviewProvider {
static var previews: some View {
ContentView()
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment