Issues developing Playground with sources folder

Hello Apple community,


I am currently developing my project for the WWDC 2018 scholarship. I am sadly running into a lot of issues which I can not seem to resolve.


My project consists of multiple files which I would like to keep in the Sources folder of the playground. So far so good - whenever I write code in these files, there is literally no code completion. It just does not work. This means that the development process is slowed down a lot! I have now tried editing the files in a normal Xcode project and reimporting them into the sources folder, which seems to work. I don't think this is intended behaviour, is it? Furthermore, often times the sources module can not even be found by the compiler, as I can see in the debug area. Is there any workaround for this?


My second question is regarding the live view of the playground: If I understand correctly, the playground uses the iOS simulator to display the live view. Is there any way to use this live view with the iPads landscape orientation? Whenever I set my initial view controller to the live view, it appears in vertical orientation, which would not make sense for my project.


I appreciate any help! Would love to win this year 🙂


Valentin

Accepted Reply

There are workarounds for enabling code completion.


Take a look here:

https://forums.developer.apple.com/thread/98692


and here:

https://stackoverflow.com/questions/48613437/xcode-autocomplete-does-not-work-in-sources-folder-of-swift-playgrounds/49324212#49324212

Replies

Same here buddy! 😠 I NEED HELP! My project consists of multiple files which I would like to keep in the Sources folder of the playground. So far so good - whenever I write code in these files, there is literally no code completion. It just does not work. This means that the development process is slowed down a lot! I have now tried editing the files in a normal Xcode project and reimporting them into the sources folder, which seems to work. I don't think this is intended behaviour, is it? Furthermore, often times the sources module can not even be found by the compiler, as I can see in the debug area. Is there any workaround for this?


I appreciate any help! Would love to win this year

There are workarounds for enabling code completion.


Take a look here:

https://forums.developer.apple.com/thread/98692


and here:

https://stackoverflow.com/questions/48613437/xcode-autocomplete-does-not-work-in-sources-folder-of-swift-playgrounds/49324212#49324212

Hey! Same here, what I did is writting all the code in the main file and then, split it. Good luck!

Same problem here. This is why I considered moving my business to Atom, and using plain old xcodebuild.

Thanks for your help! I really hope the new XCode will help us with these issues.


Do you happen to know if it is possible to change the live views orientation? I have seen some playgrounds with landscape orientation and would like to achieve that as well - setting the preferredContentSize of my initial view controller does not work - its size basically gets ignored, and the simulator always displays the view in vertical orientation.

Have there been any resolutions in Xcode Playgrounds to address this issue?