Created
August 20, 2020 13:45
-
-
Save hirauchg/d9556441148ad871f90c06f071312570 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
struct FirstView: View { | |
@State var isDisable: Bool = false | |
var body: some View { | |
NavigationView { | |
VStack { | |
Toggle(isOn: $isDisable) { | |
Text("リンクを無効にする") | |
}.frame(width: 220) | |
NavigationLink("画面遷移", destination: SecondView()).disabled(isDisable) | |
} | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment