Xcode 11 iOS playground 不再符号链接 playgroundSharedDataDirectory - 错误还是功能?

opf*_*fer 9 xcode ios swift swift-playground xcode11

Xcode 11 Playgrounds 似乎改变了以下行为playgroundSharedDataDirectory

要重现,请将以下内容粘贴到操场中并分别在 Xcode 10 和 Xcode 11 中执行:

import PlaygroundSupport

print(playgroundSharedDataDirectory)
let str = try String(contentsOf: playgroundSharedDataDirectory.appendingPathComponent("data.json")) // assuming you create  ~/Documents/Shared Playground Data/data.json
Run Code Online (Sandbox Code Playgroud)

playgroundSharedDataDirectory 决定:

Xcode 11.2:

  • iOS版:file:///Users/:username/Library/Developer/XCPGDevices/DB897D66-E542-44BD-B6CF-0176A3E480A9/data/Containers/Data/Application/2F952093-BD81-4B0C-AD45-8B5E45B4D7AB/Documents/Shared%20Playground%20Data/
  • MacOS的:file:///Users/:username/Documents/Shared%20Playground%20Data/

Xcode 10.2.1:

  • iOS版:file:///var/folders/s7/x9ltynsn2zg_djfbtzszhn8d4zn6gb/T/com.apple.dt.Xcode.pg/containers/com.apple.dt.playground.stub.iOS_Simulator.MyPlayground-5985DF99-2BFE-45AC-9F34-70620F1DCD17/Documents/Shared%20Playground%20Data/
  • MacOS的:file:///Users/:username/Documents/Shared%20Playground%20Data/

在 Xcode 10.2.1 中,iOS 操场符号链接到~/Documents/Shared Playground Data,它不再在 Xcode 11+ 中执行。

我想知道,这是故意改变吗?如果是这样,我如何从 iOS 游乐场访问共享文件?

PS:我看到了一个相关问题的答案(参见/sf/answers/4058679341/),但是,如果我运行的代码需要 iOS 操场,答案并不真正适用。