Cannot preview in this file - active scheme does not build this file : SwiftUI on Xcode 11 in CatalinaOS

前端 未结 5 1314
北恋
北恋 2021-01-17 12:35

I opened Landmark App using SwiftUI on Xcode 11 in macOS Catalina(10.15) and while opening the Canvas Editor for .swift files containing SwiftUI is showing

5条回答
  •  梦谈多话
    2021-01-17 13:10

    I encountered the same error for some of my SwiftUI View files when trying to preview on Canvas. What fixed the issue was I copied the code within the current file, deleted the file, created a new SwiftUI View file under the same name and pasted the original code. Hope that helps!

    Creating a new folder in Documents/Desktop and copying the files over also resolves the issue.

提交回复
热议问题