ios - 如何从嵌入工作区的 Swift Playground 加载 .sks 文件?

标签 ios xcode sprite-kit swift-playground

在 fileNamed 的文档中:从 .sks 文件加载场景时说:

The name of the file, without a file extension.
The file must be in the app’s main bundle and have a .sks filename extension.

我在 Playground 中的用法:

if let scene = PlanetsScene(fileNamed: "PlanetsScene") 

有什么解决方法吗?在 Playground 中运行的东西似乎无法访问应用程序主包。我已将我的 Playground 嵌入到项目工作区中,并且可以访问我设置为公共(public)的所有其他类,但似乎不能只加载 .sks 文件。

最佳答案

你能把指向原始 *.sks 文件的符号链接(symbolic link)放到你的 Playground 的 Resources 中吗?

关于ios - 如何从嵌入工作区的 Swift Playground 加载 .sks 文件?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/48331355/

相关文章:

ios - 覆盖 UICollectionViewCell 的 estimatedItemSize

ios - 新的 Xcode 配置策略和 Ionic Framework

ios - iPhone iOS 更新 14.7 后 Xcode 12.4 “Unsupported OS version”

ios - SpriteKit : node Y position and touch Y position not consistent

ios - SpriteKit 中自定义绘图的替代方案有哪些?

ios - 使用 pushViewController 传递数据?

ios - Firebase iOS GoogleSignIn 无需单击默认登录按钮即可切换

ios - 当用户向 UITableView 添加行时,返回应用程序时新行不是 "stay"

ios - 取消关注用户后 TableView 不重新加载数据 swift

ios - SKLabelNode 未出现在实际设备上