First thanks so much for your reply. I'll attach here thee code snippet
import SwiftUI
struct ContentView: View {
var body: some View {
VStack {
Image(systemName: "globe")
.imageScale(.large)
.foregroundColor(.accentColor)
Text("Hello, world!")
}
.onAppear{
ProductManager().loadProduct()
}
.padding()
}
}
struct ContentView_Previews: PreviewProvider {
static var previews: some View {
ContentView()
}
}
Below ModelView called ProductManager, which contain an empty function just to dimostrate the issue:
class Products:ObservableObject{
func loadProduct(){
}
}
I still got the same errore saying: "ProductManager" can not be found in scope... I did check also the inspector and the target is set correctly...
Topic:
Developer Tools & Services
SubTopic:
Xcode
Tags: