Skip to content

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

@nahttoter

Description

@nahttoter

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions