我如何“在 Xcode 中将这一章作为游乐场打开”?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/24028683/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-15 04:59:28  来源:igfitidea点击:

How do I "open this chapter as a playground in Xcode"?

xcodeswiftswift-playground

提问by vonlost

I have the Swift book open in iBooks, and see the note “For the best experience, open this chapter as a playground in Xcode.” How is this done?

我在 iBooks 中打开了 Swift 书,并看到了“为了获得最佳体验,请在 Xcode 中将本章作为游乐场打开”的注释。这是怎么做的?

采纳答案by Mick MacCallum

  • Launch Xcode 6
  • Documentation and API Reference Window (command-shift-0)
  • Search for “The Swift Programming Language”
  • Click first suggestion
  • 启动 Xcode 6
  • 文档和 API 参考窗口 (command-shift-0)
  • 搜索“Swift 编程语言”
  • 点击第一个建议

You will see a series of collapsable menus on the left side of the screen detailing different sections, such as “A Swift Tour”, and “Language Guide”. You can click through these to get different bits of information about different aspects of the language.

您将在屏幕左侧看到一系列可折叠的菜单,详细介绍了不同的部分,例如“A Swift Tour”和“语言指南”。您可以单击这些内容以获取有关该语言不同方面的不同信息。

Many sections will feature the “Open Playground” links that you've described, except from here, they're clickable. When you click one of these "Open Playground" links, the .playgroundfile associated with this section will be downloaded to your downloads folder, and can be directly opened with Xcode 6.

许多部分都包含您所描述的“Open Playground”链接,除了这里,它们是可点击的。当您单击这些“打开 Playground”链接之一时,.playground与此部分关联的文件将下载到您的下载文件夹中,并且可以直接使用 Xcode 6 打开。

enter image description here

在此处输入图片说明

There is even another option that allows you to open the playground files directly without first dropping them in your downloads folder.

甚至还有另一个选项可以让您直接打开 Playground 文件,而无需先将它们放入您的下载文件夹中。

In the documentation viewer in Xcode 6, search for "A Swift Tour", or any other term that you find to yield you an article you're looking for:

在 Xcode 6 的文档查看器中,搜索“A Swift Tour”或您找到的任何其他术语,以生成您正在寻找的文章:

enter image description here

在此处输入图片说明

Click a result that has a .playground icon to its left. From here, you can use the "Action" button on the right side of the window to open the file directly in an Xcode Playground.

单击左侧带有 .playground 图标的结果。从这里,您可以使用窗口右侧的“操作”按钮直接在 Xcode Playground 中打开文件。

enter image description here

在此处输入图片说明

回答by Tiberiu Oprea

It's simple, open the book on your Mac or iPad, you will see a "Download playground" link just bellow that statement "open this chapter as a playground in Xcode". You have to download that playground and open it, that's all.

很简单,在你的 Mac 或 iPad 上打开这本书,你会看到一个“下载 Playground”链接,就在“在 Xcode 中将这一章作为 Playground 打开”这一声明的下方。您必须下载该游乐场并打开它,仅此而已。

I was tricked because I thought I don't need to download the playground since I already had Xcode installed, apparently I should do it.

我被骗了,因为我认为我不需要下载 Playground,因为我已经安装了 Xcode,显然我应该这样做。