斯威夫特游乐场和游乐场书籍 [英] Swift Playgrounds and Playground Books

查看:162
本文介绍了斯威夫特游乐场和游乐场书籍的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我最近尝试打开/编辑我意识到它主要是带有清单的.swift文件包 ).

I recently tried opening/editing a .playgroundbook project in Xcode Version 8.3.2 (8E2002), and was somewhat surprised that it didn't open as a "liveView Playground" (I realize it's mostly a package of .swift files with manifests).

也许我在这里完全没有指出要点,还是这种格式从未打算使用?

Maybe I'm totally missing the point here, or was the format never intended to be used this way?

推荐答案

Swift 5,Xcode 11,Catalina

Swift Playgrounds 现在可以在iPad或

Swift Playgrounds can now run on either iPad or macOS (10.15.3 or newer).

相关: Swift Playgrounds发行说明

注意:但是,最近可用的"Swift Xcode 11.1(适用于Swift Playground 3.3的Playgrounds作者模板)不能使用当前的Xcode 11.4.1版本按原样"构建.

Caveat: However, the most-recently available "Swift Playgrounds Author Template for Xcode 11.1 (for Swift Playground 3.3)" does not build "as-is" with the current Xcode 11.4.1 release.

Xcode 8

创建和运行游乐场书表示……

您同时使用运行Xcode的Mac和iPad创建运动场书.

You use both a Mac running Xcode and an iPad to create a playground book.

*.playgroundbook唯一推荐的(受支持的?)工作流程似乎是使用Xcode编辑,在iPad上运行"

The only recommended (supported?) workflow for a *.playgroundbook appears to be "edit in Xcode, run on iPad" with Starter.playgroundbook provided as a starting point.

建议的工作流程为:

The suggested workflow is:

  1. 在Xcode中有针对性地更改图书的内容和结构
  2. 使用iCloud或AirDrop将更新后的图书转移到Swift Playgrounds中
  3. 打开更新的书并测试更改
  4. 请注意需要进行的其他任何更改,然后返回到步骤1
  1. Make targeted changes to the book’s content and structure in Xcode
  2. Transfer the updated book into Swift Playgrounds using iCloud or AirDrop
  3. Open the updated book and test the changes
  4. Note any additional changes that are needed, and return to step 1


请注意,iPad Playgrounds +New Playground Blank 创建了一个非书本 *.playground ,该书本可以在iPad和iPad上运行Xcode.


Note that an iPad Playgrounds +New PlaygroundBlank creates a non-book *.playground that can be run both on iPad and in Xcode.

页面.

注意:iPad当前使用的是比Xcode 9更高的contents.xcplayground版本,因此请在iPad上创建空白的*.playground并添加新的*.playground页面,以便在iPad或Xcode中都可以看到它们.

Note: iPad currently uses a newer version of contents.xcplayground than Xcode 9, so CREATE a blank *.playground and ADD new *.playground pages on the iPad to be seen in both iPad or Xcode.

contents.xcplayground

<playground version='6.0' target-platform='ios'>
    <pages>
        <page name='Page One'/>
        <page name='Page Two'/>
    </pages>
</playground>

这篇关于斯威夫特游乐场和游乐场书籍的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆