Created
October 19, 2019 21:34
-
-
Save raushankrjha/a227a30cee7f85fc1762e995b4623777 to your computer and use it in GitHub Desktop.
This file contains hidden or 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 | |
var body: some View { | |
VStack(spacing:50.0) | |
{ | |
Text("Number \(count)") | |
.fontWeight(.bold) | |
.font(.title) | |
.padding(); | |
Button(action: { | |
//Perform Action | |
self.count=self.count+1 | |
}) | |
{ | |
//Design Button | |
Text("Increase Counter") | |
.fontWeight(.bold) | |
.font(.title) | |
.padding() | |
.background(Color.red) | |
.cornerRadius(30) | |
.foregroundColor(.white) | |
.padding(10) | |
} | |
} | |
} | |
} | |
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