Playgrounds unresponsive/slow/unhelpful

Is it just me or Playground on Mac is super slow and unresponsive (keeps running forever, and deleting the Derived Data folder doesn't help)? Also, on both Mac and iPad Playgrounds it is super fragile. Even though the code works fine, it returns an error: "There was a problem encountered while running this playground. Check your code for mistakes", which is totally unhelpful.


It seems like a Playground Page live view can handle only a certain number of views.


Playgrounds can sometimes be incredibly stressful to work with for me, and sometimes just plain slow. I would love to hear your experiences and if this has ever happened to you!

Accepted Reply

Hey everyone, thank you all for your tips!


I have found that these two tricks have helped me tremedously:


  • iCloud Drive Sync: write code on your Mac and run it on your iPad (writing code is a lot easier on the Mac, and the iPad Swift Playgrounds app runs it a lot faster)
  • Split up subclasses into different files in the Sources folder. This will make the playground run a lot faster!

Replies

This is happening to me everyday. How the heck are you supposed to make an interactive live scene without it overloading and crashing. I have errors in Playgrounds but those aren't supposed to be errors. It's incredibly stressful.

Yes, exactly. I love Playgrounds, but I feel like I am putting more time into trying to get them to work than actually getting work done.

After working with Playgrounds for some time, I find it best to code at the Mac and test it on the iPad (sync via iCloud), where it seems to compile faster. But then you have to be careful about the changes you make, because you may receive that unhelpful error message. So I definitly agree that the experience of coding for Playgrounds can be optimized.

I have the some problems as you have. Developing an app is much faster and easier than developing a playground. Have you found a solution to your camera problem btw?

Thanks everyone for checking in! I appreciate your input, and I am glad I am not the only one experiencing this. If you have any other tips to make our experience working with Playgrounds faster and less frustrating, please share them here.

Same thing happens to me. I find playgrounds extremely buggy. It works fine on Mac but sends that error when testing on iPad. It is extremely slow and what I have is not that advanced. I posted a topic about this yesterday and I think I found a fix for making it speed up. Place your class files inside Sources file. This preconpiles those files auaotmaically so it runs much faster. Then in your main file call the classss to do everything

Thank you for your advice! That's a great tip. Have you found a way to edit source files (files inside the Sources files) on the Swift Playgrounds App on the iPad? I couldn't find a way to do so.

Yep, same here. I am working on a Mac too, because I don't own an iPad.


It's also a little annoying that the code will be compiled instantly which spits out unecessary erros which make the process even slower.


I feel like that I restart Xcode at least 3 times when coding to make it work again, paygrounds definitly need some work until they work well on Macs.


Apple, it would be great if you work on Playgrounds a little more.



Thanks

Hi Lenny, I haven't yet found a solution to my camera issue, but I have just used one of my two free Apple Technical Support TSI to get official help from Apple engineers.

That's great. Would you mind sharing their answer when they respond?

Yes, for sure!

Hi Jora, thanks for tuning in. I am wondering how iCloud sync works with playgrounds. Do your iPad playgrounds code automatically sync when you make a change on the Mac? If so, that would be sweet but I haven't found this to be the case. Thanks!

Hi Cesare, yeah that's exactly how it works for me. On the Mac, select the .playground inside the iCloud Drive folder (iCloud Drive -> Playgrounds -> yourfile.playground). Any edits there will be synced with the iPad app.

i'm having the same problem while testing my Spritekit Game! 😟

Hey everyone, thank you all for your tips!


I have found that these two tricks have helped me tremedously:


  • iCloud Drive Sync: write code on your Mac and run it on your iPad (writing code is a lot easier on the Mac, and the iPad Swift Playgrounds app runs it a lot faster)
  • Split up subclasses into different files in the Sources folder. This will make the playground run a lot faster!