Closed jakeround closed 2 years ago
Using the Demo app provided, I basically want to show the sheet only when the sheet has been toggled. Whatever I've tried seems to throw an error.
@State var showSheet = false
var body: some View {
VStack {
if showSheet == true {
Image(systemName: "film")
.resizable()
.frame(width: 100, height: 100, alignment: .center)
.foregroundColor(Color.green)
.padding(.bottom, 20)
}
}.padding(.vertical, 25)
Button(action: {
withAnimation{
self.showSheet.toggle()
}
}, label: {
Text("Show Sheet").font(.system(size: 20, weight: .medium, design: .default))
.frame(minWidth: 0, maxWidth: .infinity, maxHeight: 50)
.foregroundColor(Color.green)
.cornerRadius(10)
})
.bottomSheet(sheet)
}
Hi @jakeround
The standard style for iPad is to use the full width, so that should be no problem. Have a look at the demo app.
Regarding only showing the sheet when a movie is selected, you could do it with a custom view extension:
In fact, I think this is a great addition to the library, so I'll add it in 0.2, which I'll release in a few minutes.
I've released 0.2 now π
Thanks a lot @danielsaidi i'll take a peak later today!
Much appreciated for taking a look at my issue so quickly π
I havenβt revisited this library since creating it, so it was great that you reminded me π
Hello ππ»
I'm attempting to use BottomSheet to build my Movie app Sonix (I'm fairly new to Swift/SwiftUI) basically i'm trying to replicate the design which is attached so each movie opens BottomSheet at full width. At the moment the only way I have it working is wrapping inside .sheet using isPresented.
Any help would be much appreciated