fixed
Post
Replies
Boosts
Views
Activity
Updated Question
struct GameView: View {
var viewModel = GameViewModel()
var body: some View {
ZStack {
GameColor.main.ignoresSafeArea()
VStack {
Text(viewModel.questionProgressText)
.font(.callout)
.multilineTextAlignment(.leading)
.padding()
QuestionView(question: viewModel.currentQuestion) --> error here
}
.foregroundColor(.white)
.navigationBarHidden(true)
.environmentObject(viewModel)
}
}
}
struct ContentView_Previews: PreviewProvider {
static var previews: some View {
GameView()
}
}
Error
Value of type 'GameViewModel' has no member 'currentQuestion'
I can't edit My initial Question
thanks it worked