Search code examples
swiftxcodedirectoryswift-playgroundxcode10

Unable to create folders in Xcode Playgrounds?


I used playgrounds for the first time in months, and when trying to create a new sub-folder under the sources folder, it creates a working folder which called 'untitled folder', when I then rename that folder to something else, it stops working as a folder in playgrounds, the little arrow disapears and you can't open it anymore. When checking out the folder in finder it shows up as a normal working folder which can contain files etc. I was wondering if anyone here has experienced this or knows some way to fix this? Thanks!


Solution

  • Although I don't know the reason why the folder disappeared or why you need the folder, I have a simple method to recover the fold sign (little arrow) back for an empty folder.

    For example, if you change the name to "hello" and the little arrow disappeared. Just add a " 2" after the "hello" to from the "hello 2". Then close the playground. When coming back, the little arrow appears.

    Now you may remove the " 2" to get the real name "hello". Reopen again, and you have the folder "hello".

    This is only applicable to an empty folder. If you have files in the folder, you have to use the original name to get the little triangle sign back.

    Actually you may create a new empty folder and drag and drop those files to the new folder in the playground.