Skip to content

Instantly share code, notes, and snippets.

@hirauchg
Last active August 20, 2020 13:56
Show Gist options
  • Save hirauchg/18f820355b5454852b7cf5d8547a662d to your computer and use it in GitHub Desktop.
Save hirauchg/18f820355b5454852b7cf5d8547a662d to your computer and use it in GitHub Desktop.
他のViewのイベントから画面遷移
struct FirstView: View {
@State var flug: Bool = false
var body: some View {
NavigationView {
VStack {
NavigationLink(destination: SecondView(), isActive: $flug) {
EmptyView()
}
Button("ボタン") {
self.flug = true
}
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment