解决方法
我能回答的是在iPad上运行在Xcode中创建的Playgrounds的可能性,答案是肯定的.我在下面概述了我尝试的内容,但可能有解决方案,我很遗憾,所以请随时贡献.
首先,我在MacBook Air上安装了Xcode 8.2.1,这使我能够创建新的Playgrounds项目.另外,我有一台安装了Swift Playgrounds应用程序的iPad Air.我相信Swift Playgrounds至少需要iOS 10才能运行.
我做了一些研究,找到了Apple Swift Playgrounds的主页.底部是文字:
Take things to Xcode. Then take them further. Because you’re working
with real code,you can import and export directly between Swift
Playgrounds and Xcode. So you can try out your ideas with the tool
pros use to develop iOS and Mac apps.
我想试验并弄清楚如何“直接在Swift Playgrounds和Xcode之间导入和导出”.
首先,我在Xcode中创建了一个名为Test.playground的新的简单“Hello World”Playground.你可以想象它看起来像下面这样:
import UIKit print("Hello World")
其次,我使用AirDrop将Test.playground从我的MacBook Air转移到我的iPad Air.我的iPad给了我保存到iCloud Drive的选项,所以我做到了.这是需要在“设置”中启用的功能.
第三,我在iPad Air上推出了Swift Playgrounds应用程序.左上方的标志允许您“创建游乐场”或访问iCloud Drive(或Dropbox等)以导入Playground.我选择了iCloud Drive,因为那是我从MacBook Air AirDropped我的Test.playground. iCloud Drive将有一个文件夹,存储应用程序的所有Playgrounds,名为“Playgrounds”.点击该文件夹,我可以看到我选择的Test.playground.
选择Playground后,它应该打开.我能够按“运行我的代码”并打印出“Hello World”.
这就是我弄清楚如何在Xcode和Swift Playgrounds(在iPad上)之间导入/导出Playgrounds.我必须进行更多实验以确定两个平台之间的全部功能/相似性/差异(在iPad上的Swift Playgrounds应用程序中运行Xcode和Playgrounds中的Playgrounds).
希望这会有帮助.
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。