Created
October 16, 2020 17:03
-
-
Save mchirico/f13b9275a97bb797ecbde703a7e619c6 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import SwiftUI | |
struct ContentView: View { | |
@State var count: Int = 0 | |
@State var txt: String = "Label:" | |
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 = "count: \(self.count)" | |
print("count: \(self.count)") | |
} | |
) { | |
Text("button") | |
.fontWeight(.heavy) | |
} | |
Text("Hello, world!") | |
.font(.headline) | |
.foregroundColor(Color.blue) | |
.multilineTextAlignment(.center) | |
.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