Xcode: Any way to refresh/re-run the playground?

shim picture shim · Sep 30, 2014 · Viewed 28.5k times · Source

The Playground in Xcode automatically updates as you type, but I can't figure out how to get the Playground to "re-compile".

In many cases this wouldn't matter, but if you're writing code that generates or uses random values it can be useful to run it a few times to make sure it's working. Is there any way to get the playground to reset / refresh / re-run?

Seen a few questions asking how to stop the Playground from auto-updating, but nothing for the opposite.

Easiest way to do this seems to be to just edit the code (add and remove a space), or put in some kind of a loop... Just wondering if there's a menu shortcut etc.

Answer

rintaro picture rintaro · Oct 1, 2014

Try Editor > Execute Playground from Xcode menu

enter image description here

I don't know what Reset Playground is, by the way.