Created
October 23, 2024 16:17
-
-
Save takoikatakotako/0720cf28d68ad661a25972f89bac813b to your computer and use it in GitHub Desktop.
SwiftUIでシートを表示し、プッシュ遷移後にシートを閉じる
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 showingSheet: Bool = false | |
| var body: some View { | |
| Button(action: { | |
| showingSheet = true | |
| }, label: { | |
| Text("ShowSheet") | |
| }) | |
| .sheet(isPresented: $showingSheet) { | |
| FirstSheet(showingSheet: $showingSheet) | |
| } | |
| } | |
| } | |
| #Preview { | |
| ContentView() | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment