更新时间:2023-02-02 07:54:11
首先要感谢 Nate Cook 的快速响应和可靠的答复.
I have to thank Nate Cook for first for his quick response and solid answer.
为了以防万一,我从另一个帖子中分享了他的回答,该标题具有误导性.
Just for case I share his answer from another post, which title is misleading.
在此处查看 Nate 的回答:https://***.com/a/26723557/2360439
See Nate's answer here: https://***.com/a/26723557/2360439
Playgrounds 是沙盒化的,因此您将无法从用户文件夹中的任何位置抓取文件.以下是如何将该文件添加到您的游乐场使其易于访问:
Playgrounds are sandboxed, so you won't be able to just grab files from anywhere in your user folder. Here's how to add that file to your playground to make it accessible:
似乎无法在 Playground 沙箱之外使用 Swift Playground 访问文件.如果您知道如何在沙箱外访问文件,欢迎分享您的解决方案!!
Seems that there is no way to access files with Swift Playground outside of Playground sandbox. If you know how to access files outside of sandbox, you are welcome to share your solution!!