Created
October 11, 2022 08:08
-
-
Save Drag0ndust/2ab8e0a2568c156beb7ee2ffc7f284f3 to your computer and use it in GitHub Desktop.
iOS 16: Bottom Sheet
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 MyBottomSheet: View { | |
@State private var showSheet = false | |
var body: some View { | |
ZStack { | |
Color.green | |
.ignoresSafeArea() | |
Button { | |
showSheet.toggle() | |
} label: { | |
Text("Show sheet") | |
.accentColor(.white) | |
} | |
} | |
.sheet(isPresented: $showSheet) { | |
ZStack { | |
Color.blue | |
Text("My awesome sheet") | |
} | |
.background(Color.blue) | |
// .presentationDetents([.medium, .large]) | |
// .presentationDetents([.height(100)]) | |
// .presentationDetents([.fraction(0.3)]) | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment