I need to use canvas to display PreviewProvider. But I do not need classes like Text Button, VStack and others to be visible in my entire file. What exactly i need to import to use Canvas? I look for something like import protocol SwiftUI.CanvasPresentable and this protocol makes XCode to use Canvas without import whole SwiftUI
What exactly should I import so as not to import whole SwiftUI to use XCode Canvas?
Hi,
Sorry to hear this is causing you issues, but currently there is a requirement that your file imports the SwiftUI module to get the canvas to be visible. Presumably the module being built does in fact use SwiftUI. Is there any specific reason why you are concerned with the SwiftUI symbols being available in the current file?
Thank you. I found solution in #if statement, to escape the import.