Skip to content

How can I close it to open another one ? #99

Answered by lucaszischka
X901 asked this question in Q&A
Discussion options

You must be logged in to vote

Im not quite sure what you want to do. A code snipped would be great next time. Also this is not a issue but a question. Converting to discussion.

However I think this is what you want:

@State var bottomSheetPosition1: Bool = .relative(0.4)
@State var bottomSheetPosition2: Bool = .hidden

var body: some View {
    // Your view
    .bottomSheet(bottomSheetPosition: self.$bottomSheetPosition1, )
    .bottomSheet(bottomSheetPosition: self.$bottomSheetPosition2, )
}

func yourButton() -> Void {
    // Close one sheet 
    self.bottomSheetPosition1 = .hidden
    // Open the other one
    self.bottomSheetPosition2 = .relative(0.6)
}

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by lucaszischka
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants
Converted from issue

This discussion was converted from issue #98 on September 06, 2022 00:07.