B Ohr writes:
@ericasadun just successfully created a symbolic link in the Sources folder of a playground to a swift file outside with Xcode 6.3.2
— B. Ohr (@J7zz) May 23, 2015
So I put it to the test.
Single File Test
First test: a single file at the top level of a playground.
- Create a playground
- Navigate to its Sources (with the playground closed)
- Create symbolic link
% cd Sources/ % lns ~/Desktop/test.swift test.swift Made test.swift -> /Users/ericasadun/Desktop/test.swift
Next, I launched the playground, opened the project navigator, edited test.swift, and attempted to save it.
Every time I then tried to close the playground, I got this:
I had to force-quit Xcode. The edits never made it to the file. I’d call that a fail.
Next up, symlinks to source folders. Same steps but the source is enclosed in a top-level folder.
% cd ~/Desktop/SymTest2.playground/ % cd Sources % lns ~/Desktop/External\ Sources/ External\ Sources Made External Sources -> /Users/ericasadun/Desktop/External Sources
This time, I was able to load, tweak, and save without incident. So, that’s a success.
That said, I did encounter issues with otherwise “behaving” symlink playgrounds. There was this:
And sometimes there was this:
which did ever not resolve, even after I left it for a quarter an hour to spin its wheel. This happened specifically after I closed a symlinked playground, created an additional symlink and then re-launched.
Although you’re likely to have greatest success using symlinks to enclosing folders, the entire symlink system remains pretty fragile. Caveat codeur.