I have a preview struct in a swift file that has a view I am working on. It is able to preview the contents of the file (the view), but when I select, for example, a VStack, it does not highlight it in the previewer. I know I am in live preview mode and not in interaction mode. Here is the content preview struct:
struct ContentView_Previews: PreviewProvider {
static var previews: some View {
ProfileSheet()
}
}
(ProfileSheet is the name of the View)
To add some additional quirkiness to this issue, when I move the previewer to another file (just the struct), and preview the same ProfileSheet() as before, it works as normal, so I dont think it is an issue with my view. To further remove the specifics of my view from the equation, I put a Text("test") in the content Previewer, and when it was in the "broken" file it didn't select, but it did in the other. Finally, In the working file, the toolbar above the previewer is functioning as normal, but in the "broken" one all the options (besides enter inspection mode) are greyed out.
For more context, I have tried restarting Xcode, and removing / reinstalling it, as well as cleaning the build folder, none of which seemed to help.
Before this problem happened, I was facing another issue with the previewer, which I asked about here, Content Previewer not loading on Xcode 12.5.1, and got a solution to. I have implemented the solution, so that may be contributing to this odd behavior.
If there is any work around for this problem that would be great, I really need to get back to being able to work on this project, thanks :)