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

Issue with Enum_ 'State' cannot be used as an attribute #2

Open
nahttoter opened this issue Dec 12, 2019 · 1 comment
Open

Issue with Enum_ 'State' cannot be used as an attribute #2

nahttoter opened this issue Dec 12, 2019 · 1 comment

Comments

@nahttoter
Copy link

nahttoter commented Dec 12, 2019

Hi,
Thanks for providing such a nice solution
Have anyone ever faced with next issue:
Enum 'State' cannot be used as an attribute

My code is next:

import SwiftUI
import SwiftUIRefresh
struct ListView: View {
@ObservedObject var viewModel: CarsViewModel
@State private var isShowing = false //Error is here

var body: some View {
        VStack {
            Text("List Representation")
                .padding(10)
            List {
                ...
                }
            }
        }.background(PullToRefresh(action: {
            DispatchQueue.main.asyncAfter(deadline: .now() + 1) {
                self.isShowing = false
            }
        }, isShowing: $isShowing)) ////Error is here
    
}

}

Thanks for suggestions

@Luur
Copy link

Luur commented Jan 16, 2020

Hello @nahttoter

Could you please check if you have class or struct with name State in your code? If yes, it could be a conflict between you custom class/struct State and default attribute @State

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants