Xcode 6 Beta / Swift - Playground not updating

harveytech picture harveytech · Jun 8, 2014 · Viewed 13.1k times · Source

I was playing around with the Playground feature of Xcode 6's first beta - and I notice half the time the Playground doesn't update (simply doesn't display the result calculation or how many loop iterations are happening) simple code/loops/functions that are in there. Even the Swift Tour https://developer.apple.com/library/content/documentation/Swift/Conceptual/Swift_Programming_Language/GuidedTour.html

has several lines of code that don't show up in Playground. If you mess with the code sometimes it will show up, by moving the code around or placing it elsewhere. Anyone else? Any fixes? Is this just a beta problem?

Answer

rcw3 picture rcw3 · Jun 8, 2014

Make sure you haven't inadvertently added an error to your Playground code. Unfortunately, there is no inline notification of an error, and after an error is created, nothing in the Playground will update.

To help with this, open up the Assistant Editor (File > View > Assistant Editor > Show Assistant Editor), which should include a Console Output box. If there are any errors in your Playground, they will show up there. Once corrected, your Playground should hopefully update once more.

That said, it can be a bit slow depending on the complexity of your Playground and its size.