Xcode 11: Canvas does not show up

2020-01-31 12:25发布

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?

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?

11条回答
ら.Afraid
2楼-- · 2020-01-31 12:45

This could be the effect if you upgraded Xcode to a higher beta version and got the following error message during the process:

Loading a plug-in failed

The plug-in “com.apple.dt.UVKit” at path “/Applications/Xcode-beta.appDownloads/Xcode-beta.app/Contents/PlugIns/UVKit.framework” could not be loaded. The plug-in or one of its prerequisite plug-ins may be missing or damaged. The plug-in or one of its prerequisite plug-ins may be missing or damaged and may need to be reinstalled.

The solution seems to be to upgrade the Catalina beta version to the same level. Here's the link to Apple's Beta Software Downloads.

查看更多
ゆ 、 Hurt°
3楼-- · 2020-01-31 12:47

Update Mac OS version 10.15 or upper version. Update Xcode 11 or upper version. After that click Editor > Canvas for code preview.

Bonus: If you would like to see code preview left side, you can change layout from Menu Icon > Layout > Canvas Right. (I shared screenshot)

Bonus info screenshot

@canerkaseler

查看更多
Viruses.
4楼-- · 2020-01-31 12:51

To further add to the other answer, as per the official tutorial from Apple:

To preview and interact with views from the canvas in Xcode, ensure your Mac is running macOS 10.15 beta.

Unfortunate that I can't run it right now since the beta was just released and I don't have a spare Mac!

查看更多
何必那么认真
5楼-- · 2020-01-31 12:55

you have to install macOS at least version (10.15 or above)

查看更多
一纸荒年 Trace。
6楼-- · 2020-01-31 12:58

The preview only works on MacOS 10.15 Beta

You need to tap on Editor and Canvas Option in Xcode 11.0-Beta, alternatively you can tap on Editor -> Editor and Canvas from top options

Attached screenshots for refrence.Image

image 2

查看更多
登录 后发表回答