0

The top level of my app looks like:

struct MyApp: App {
    var body: some Scene {
        DocumentGroup(newDocument: MyDocument()) { file in
            MyContentView(document: file.$document)
        }
    }
}

How do I create a preview for it? #Preview expects a View, not a Scene. I can (and did) create a preview for MyContentView, but that does not show the extra line with the document title that DocumentGroup adds on top, so I cannot judge the overall layout properly.

To illustrate, here's a screen shot. The green area is what MyContentView would show. The red area is the document related line added by DocumentGroup that I currently cannot preview.

2
  • 1
    Scenes cannot be previewed, period. What "extra line" are you talking about? Commented Nov 19 at 13:28
  • @Sweeper, I've now edited my post to add a screen shot and explain better what I mean. Commented Nov 20 at 12:22

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.