Search code examples
iosswiftxcodeswiftuixcode11

Xcode Canvas for SwiftUI previews does not show up


I´m trying to get the new Canvas feature from Xcode 11 running, but the Canvas won´t show up. What am I doing wrong?

This new Xcode feature should show a live preview of my SwiftUI views without running the app.

When you create a custom View with SwiftUI, Xcode can display a preview of the view’s content that stays up to date as you make changes to the view’s code. You define a structure that conforms to the PreviewProvider protocol to tell Xcode what to display. Xcode shows the preview in a canvas beside your code.

https://developer.apple.com/documentation/swiftui/previews-in-xcode

I just created a new default project (single view app), compiled it and activated 'Editor > Editor and Canvas'. I can navigate to each file in the project, nothing shows up.

What else does need to be done?


Solution

  • You need to be on Catalina macOS version (10.15), as stated in official tutorial

    Be warned: Catalina doesn't support 32-bit applications, some old apps will stop working after update.