Created
October 24, 2024 00:55
-
-
Save takoikatakotako/26a6826ba71904e2cf69b5e1ceda193a 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 = false | |
| var body: some View { | |
| Button(action: { | |
| showingSheet = true | |
| }, label: { | |
| Text("Show Modal!") | |
| }) | |
| .sheet(isPresented: $showingSheet) { | |
| Text("Half Modal") | |
| .presentationDetents([.medium]) | |
| } | |
| } | |
| } | |
| #Preview { | |
| ContentView() | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment