Reputation: 6822
I am seeing the following error in iOS14, I am not sure if it is a bug or a user error :-) I appreciate it is still in beta, so I will post this in the developer forums as well.
I am seeing the following error come up when I make a macOS app in SwiftUI - when I create the same as an iOS app, the error does not appear.
Do I need to do something special for macOS apps when it comes to importing SwiftUI modules?
Upvotes: 23
Views: 29067
Reputation: 11
Had this today, but found that I renamed my file's name but I forgot to rename the corresponding struct within it. That fixed my issue.
Upvotes: 1
Reputation: 586
You need to make sure that you've selected "Create folder references" when adding a new file to the project.
Upvotes: 0
Reputation: 881
In my case the reason was that the protocol I was inheriting in the class, needed to be made public.
Upvotes: 3
Reputation: 1
When you rename a swift View from Project navigator or refactor the name within a struct, check that the struct and preview name were updated accordingly.
Upvotes: 0
Reputation: 3430
Had this issue today because I renamed the file that contained the class. The solution was to delete the file and recreate it.
Upvotes: 11
Reputation: 4726
This will solve the problem.
Upvotes: 3