Tuesday, June 17, 2014

Swift Playgrounds Introduction

So finally I had some time to explore the swift playgrounds. One thing I would like to say about playgrounds is that It's awesome and cool...

So here is the icon that they have given to the playground document type.

Clearly icon goes with the name. But believe me it does goes with the icon, its a child play to use the playground. You just open up the playground and you are ready to code.



So considering my self just a child in the Swift programming era. I would like to explain few of the features of the Playground while enjoying the seesaw .. :)

I know you can locate the playground option in the Xcode 6 beta when you start the Xcode. But I would like to just show the options.




As you see the first option "Get started with a playground". As the title says "Explore new ideas quickly and easily".. That's the way swift playgrounds are.. Quick and Easy...

Once you open up the playground here is what you will see:


On the left hand side is your code and on the Right hand side is your code output line by line.

We will not talk about the Swift language and why import Cocoa is there. 

There are not too many items around the playground. So lets just show them one by one. Pull up the view option from the Menu and click Show Toolbar. You will be able to see the Toolbar and your fav icons in the Top Right of the Playground.



You are aware what all these options do..

If you move your cursor over the output of the value you will see little Icon on the right side. 

Mouse hover on the icon and you will the text "Value History". As the name suggest it will show the value history in the timeline. Just press this icon and you will see the value in a timeline. If you have changed the value of the course of you Play, you can just click the icon and it will show the timeline.
Whatever value you have selected corresponding Timeline will be highlighted in Green.


And there is another Quick Look icon to take a sneak peek at the value. You can create custom  Quick Looks to view your own classes.

I hope these can help you get started.. :)

You can always go to WWDC Videos and search for the Playground Introduction.

Happy Coding!!





No comments:

Post a Comment