-
Notifications
You must be signed in to change notification settings - Fork 20
Open
Description
If you're coming from "DesignCode" videos, you may not have been able to find BottomSheetView due to the old version. With the new version, if you make the following adjustments, you will achieve the desired result.
All you need to do is:
@State var isBottomSheetPresented = true
@State var selectedDetent: BottomSheet.PresentationDetent = .medium
EmptyView()
.sheetPlus(
isPresented: $isBottomSheetPresented,
background: (
ForecastView()
),
main: {
EmptyView()
.presentationDetentsPlus(
[.height(0), .medium, .large],
selection: $selectedDetent
)
}
)isBottomSheetPresented determines whether the Bottom Sheet is open or closed, while selectedDetent allows us to control its size. With the code written in [.height(0), .medium, .large], we can open it to medium height, enlarge it to large, or completely close it thanks to .height(0).

Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels