This apple developer page introducing Swift has a link 3 paragraphs down for downloading the "GuidedTour.playground" file, which is supposed to allow you to follow along interactively with the tutorial. However, when I open this file in XCode6 Beta (I'm on a 2 month old MB pro, OSX 10.9.3), I see only this screen, which does not respond to mouse clicks or anything else (NOTE: "GuidedTour.playground" is the foreground window, there is another default playground window behind it):
How can I make it work?
Bonus Question: Probably unrelated, but when I play with the default playground I can't figure out where println
statements are supposed to output to. They don't appear in the realtime righthand pane, or in the console at the bottom.
Double click on the file: GuidedTour.playground All you will see is the document but it is interactive. Just make changes to the code and you will see the results change. To add a new line click on the end of an existing code line and press enter, you will get a new line to enter code.
If you want to see the entire Xcode environment:
Hello, world
50
Note: It is even more confusing when the instruction is read in iBooks on an iPad.
To get a new Playground is somewhat counterintuitive, you do not want a New:Project, instead: Menu File:New:File... and then choose a Template either iOS:Source:Playground or OSX:Source:Playground
After many tries, I found out that when I download the file, it asks me if about the extension (in Chrome, sorry in French).
I always answered "Use .playground" and it resulted in an unusable file as listed by the question here. Finally I tried to use .zip extension, unarchive the file, and it works just as fine !
Hope it helps :)
It's opening the playground in preview mode for some reason. Try this with the playground window in the foreground:
On the menu bar, choose Navigate -> Reveal in Project Navigator. The project navigator should open on the left side of the screen. Now right click on the playground file in the project navigator and choose Open as -> Playground.
I think what you might be looking for is the assistant editor, when I showed that, I found my console output as well as timeline.
You also need to print something for it to show up on console output, except for the timeline, i didn't need to do any prints for that. I did notice that i had to fiddle with the assistant editors before the little symbol next to the output showed up for me to view the timeline.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With