Update Xcode 13 The code sample below works as expected in Xcode 13.
Update from Apple Frameworks Engineer October 2020:
Unfortunately there is no current workarounds to let you preview this outside of the live preview.
Is it possible to create a SwiftUI preview of a presented sheet without running the Live Preview? For example:
struct Sheet_Previews: PreviewProvider {
static var previews: some View {
Text("Background").sheet(isPresented: .constant(true)) {
Text("Sheet")
}
}
}
The above results in the following preview:
In order for the sheet content to be presented in the preview, you must run the Live Preview:
Xcode 13.0 seems to handle this correctly without starting a Live Preview.
So this is working now: