Unresolved identifier trying to preview SwiftUI screen

Something really strange is happening, and I'd like you guys to help me solve this.


I have a screen designed in SwiftUI and when I try to preview it with a code that calls a class with some logic to perform some network calls, XCode says that my class is an "Unresolved identifier". Does anyone know why this is happening?


For example:


Button(action: {  MyController.performSomething(with: something) })

In this case, XCode is reporting "Use of unresolved identifier MyController"


Could someone help me please?


Thanks in advance.


Replies

Could you show the complete code, so that we see how you defined the class and how you use.