In my new SwiftUI Multiplatform Project for iOS and macOS I get the Error "Cannot find type 'MyClass' in scope", but only when I try to compile the macOS version of it and not when compiling on the iOS part of the Project, there all works fine and the App runs.
I have only added few code to the Project and it is all in the Shared Folder, I have not done anything specific for one Platform. How can I get my App to detect my class in the macOS version? I guess it is not defined there, but I do not understand why.
What is included in the scope depends on the target membership of each file in conjunction with the build scheme. For the file that isn't being included in macOS, open the file inspector (top right pane of Xcode) and make sure the macOS target membership is checked. When you create a new file in Xcode the target membership is one of the things you specify and can always be changed here.