ringside
ringside

Reputation: 25

Xcode 9.4 Playground Swift Console Outputting

enter image description hereI just decided to learn Swift as a new language and I downloaded Xcode and have been following the Apple's Swift learning course. The console won't print() anything. I know it can't be a syntax error, because I haven't even touched the code that they have as an example that is supposed to show the print() function working. I do have the bottom pane open and the pane on the right open as well.

Debugging Tried So Far:

I tried the "view -> Show Assistant Editor". No dice... I Originally had Xcode 9.4.1 and saw that it had just been released, so I uninstalled and downloaded Xcode 9.4 thinking that it might solve the issue.

Thanks for the help!

Screen shot: enter image description here

Upvotes: 0

Views: 687

Answers (1)

Rick
Rick

Reputation: 150

Your code is still compiling (translating to machine code) here (recognise this by looking at the toolbar at the top). You should wait a few moments until it's finished. Your code is correct.

If it takes longer, try restarting Xcode or even your Mac.

Code recompiles every time you make a change in an Playground. This isn't the case in projects. I wouldn't recommend using projects because

  • they don't have instant feedback;
  • contain other mess that will distract you from learning swift;
  • they need to be rebuild every time you make a change.

Upvotes: 1

Related Questions