I have been working on an Xcode project in SwiftUI for some time now and all of a sudden this message (No exact matches in reference to static method 'buildExpression') started to pop up, when I ran the build. I tried cleaning the builds and this still has not worked. I am unable to figure out where this error is referring to so some help we be nice. Thanks!
No exact matches in reference to static method 'buildExpression'
Could you show code where error occurs ? Is buildExpression a method you defined ?
Of course! The error occurs on the line that says .environmentObject(registrationViewModel)
import SwiftUI
struct ContentView: View {
@StateObject var viewModel = ContentViewModel()
@StateObject var registrationViewModel = RegistrationViewModel()
var body: some View {
Group {
if viewModel.userSession == nil {
LoginView()
.environmentObject(registrationViewModel)
} else if let currentUser = viewModel.currentUser {
MainTabView(user: currentUser)
}
}
}
}
struct ContentView_Previews: PreviewProvider {
static var previews: some View {
ContentView()
}
}
Ok. I posted It below so I was able to fit all the code in it.