Recently when updating to the latest Xcode 13 and simply just saving the project the following key-value pair has been added to ProjectName.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings
<key>PreviewsEnabled</key>
<false/>
I could not find any information on the internet that explains what this refers to I am only assuming it has something to do with the SwiftUI's preview but I would be grateful if someone could shed some light on this.
The closest thing I found was Build Settings Reference which is a detailed list of individual Xcode build settings that control or modify how a target is built. One of the settings was ENABLE_PREVIEWS
which, if enabled, will build the product with the appropriate options to support previews.
Have a look at this
[More Informations]:
The "PreviewsEnabled" key in the WorkspaceSettings.xcsettings file controls whether previews are enabled or disabled for a given Xcode workspace. When this key is set to "true", previews are enabled and you can see previews of your SwiftUI views in the Xcode canvas. When it's set to "false", previews are disabled and you won't be able to see previews in the canvas.
By default, when you create a new Xcode project with SwiftUI, the "PreviewsEnabled" key is set to "true". However, you can change this setting to "false" if you don't want to see previews in the Xcode canvas.
It's worth noting that even if previews are disabled, you can still run your app on a simulator or device to see what it looks like. However, using SwiftUI previews can save you time by allowing you to quickly iterate on your design without having to wait for the app to build and run every time you make a change.