SwiftUI Preview Sheet w/o Running Live Preview?

(Cross post from: Stack Overflow)

Is it possible to create a SwiftUI preview of a presented sheet without running the Live Preview? For example:

Code Block
struct Sheet_Previews: PreviewProvider {
static var previews: some View {
Text("Background").sheet(isPresented: .constant(true)) {
Text("Sheet")
}
}
}

The above results in the following preview:
(See image 1 on Stack Overflow)

In order for the sheet content to be presented in the preview, you must run the Live Preview:
(See image 2 on Stack Overflow)

Replies

Hi,

Unfortunately there is no current workarounds to let you preview this outside of the live preview.

This works in Xcode 15 beta 4 🎉