Refresh Playgrounds 4 code evaluation

It happens a lot that code evaluation in Playgrounds (the labels that say you have compile bugs or warnings in your code) gets stuck. So in order to fix them I sometimes must force quit the whole Playgrounds app. Sometimes I even have to completely restart iPadOS.

I know triggering Build in Xcode usually fixes those problems in Xcode... so I wonder: is there, or, why isn’t there… a Playgrounds alternative to Xcode’s Build command?

(Using Playgrounds 4.0.2 on iPadOS 15.4.1 running on the M1 iPad Pro)

Yes, I have this problem too but with the 4.0.2 update it’s gotten better, at least it feels it happens less often, usually warnings, and I haven’t needed to reboot the device to get it unstuck (relaunching app is enough).

When it does get stuck I’ll do one or both of these things in either order

  1. Intentionally add a space to break code around where it’s stuck then delete the space. This triggers the compiler to start working again and hopeful clears the hang up.
  2. With the preview/Canvas panel open, at the top it says “App Preview”. Tap on that show show a menu and choose “Restart” or “Delete Data and Restart”. This will get the compiler to try again.

If neither of those work (usually happens with a warning about a variable that’s no longer in my code) then I have to restart Playgrounds and that’s always rectified things since 4.0.2.

You can also send feedback that this needs improving (open a project, tap top-right circle icon with 3 dots inside, select “Send Feedback” from menu). I don’t understand the technical problem with it getting stuck but a button to force a more complete recompilation I think would help.

Refresh Playgrounds 4 code evaluation
 
 
Q