Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Working in xcode 13? #13

Open
tcollins590 opened this issue Oct 30, 2021 · 4 comments
Open

Working in xcode 13? #13

tcollins590 opened this issue Oct 30, 2021 · 4 comments
Labels
bug Something isn't working

Comments

@tcollins590
Copy link

I am receiving the following error

Cannot convert value of type '[Int]' to expected argument type 'Binding<[CGFloat]>'

@tcollins590 tcollins590 added the bug Something isn't working label Oct 30, 2021
@maustinstar
Copy link
Owner

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.

@mattpilott
Copy link

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)

@CaryAndo
Copy link

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.

@josipbernat
Copy link

The code snipped from documentation doesn't work on Xcode 14 but following does:

Drawer(heights: .constant([100, 340])) {
    Color.blue
}.edgesIgnoringSafeArea(.vertical)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

5 participants