swiftui-drawer
swiftui-drawer copied to clipboard
Working in xcode 13?
I am receiving the following error
Cannot convert value of type '[Int]' to expected argument type 'Binding<[CGFloat]>'
Thanks for pointing this out. The docs are outdated, and the parameter should be a binding CGFloat array, not an Int array. Try using .constant([...]) with your numbers inside there, like in this example.
I tried to use this today and despite resolving all issues and using this example, all i got was an empty app. I don't think it's working out of the box in xcode 13
Drawer {
ZStack {
RoundedRectangle(cornerRadius: 12)
.foregroundColor(.white)
.shadow(radius: 100)
VStack(alignment: .center) {
Spacer().frame(height: 4.0)
RoundedRectangle(cornerRadius: 3.0)
.foregroundColor(.gray)
.frame(width: 30.0, height: 6.0)
Spacer()
}
}
}.edgesIgnoringSafeArea(.vertical)
.rest(at: .constant([100, 340, UIScreen.main.bounds.height - 40]))
.impact(.light)
Confirmed, if you create a new project and add the example code to it you get an empty app, even if you adjust for the @Binding like you mentioned. This project doesn't seem to work at all anymore.
The code snipped from documentation doesn't work on Xcode 14 but following does:
Drawer(heights: .constant([100, 340])) {
Color.blue
}.edgesIgnoringSafeArea(.vertical)