How to preview an `App` class in xcode?

Views can be viewed on the canvas in XCode via the code below.

#Preview {
    ContentView()
}

But how do I preview an App class in XCode?

Background: I'd like to preview various settings done in the Scene of the App.

Answered by Developer Tools Engineer in 815504022

Hi,

Unfortunately there currently isn't any way to preview an App in a regular xcode project. A Swift Playgrounds project has the "App" preview which may suffice for you, though I suspect your project isn't a Swift Playgrounds one.

If I understand your question, just use simulator. It is done to allow testing app on any type of device.

Accepted Answer

Hi,

Unfortunately there currently isn't any way to preview an App in a regular xcode project. A Swift Playgrounds project has the "App" preview which may suffice for you, though I suspect your project isn't a Swift Playgrounds one.

How to preview an `App` class in xcode?
 
 
Q