Created
August 19, 2020 12:43
-
-
Save hirauchg/0e896aa622256e1ccf5b52140c69b6a3 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 text = "ボタンをタップしてください。" | |
var body: some View { | |
VStack { | |
Button("ボタン") { | |
self.text = "タップされました。" | |
}.padding() | |
Text(text) | |
} | |
} | |
} | |
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