Insights from Our Experts

Blog image

Swift Playgrounds!

Author Image

Milen Louis,Software Engineer

“PLAYGROUND” was introduced in Xcode by Apple for iOS and OS X developers. In the latest WWDC, Apple has announced that playground is now available in iPad as well. It is an interactive environment that is nested within Xcode and it provides instant feedback of your code without requiring you to actually compile and run a complete project.


Now, let us talk about how to create a playground. In Order to create a playground you need to install Xcode first which is Apple’s  programming application for developers : click here to install Xcode from the Mac App Store. After installing Xcode, launch it and you will see something like the image below. 


Click “Get started with a playground”, choose a name for it and then click create. Done!!! You have now successfully created a playground. Playgrounds are tiny Swift testing environments which lets you type code and see the results immediately. You do not really build actual apps with them, but they are great for learning. It is a really great feature as it enables you to isolate and run your code before translating it over to your entire project.


Okay, now let us take a peek into ‘how playground works’. A playground has two columns; the left column is where you write your code and the right column is the results sidebar where you can see the output of the code you have written in the left column.


There is a ‘value history’ option on the results sidebar. When you click this, another window pops up which is called the playground timeline. Another cool feature is the slider present at the bottom of the window. You can slide it to see how your value changes over time. This is such a crucial feature since no other application provides a mechanism to review the value changes in a graphical format.The image below clarifies the statement by counting the number of times a loop executes along with a graph whose purpose is to notify the change in value over time.Beginners who actually try to pave their way deep into iOS and OS X can infact create a strong knowledge through playground. Playground makes hard things look easy and simpler. It is obvious from our experience that pictorial analysis is far more perfect than logical analysis.

There are a lot more other interesting features about playground. Check those out at About Playgrounds - Apple Developer. Playground is infact a great start for developers especially beginners. It is an interactive plot where we can perform an action to get back a reaction. 

So, that’s it guys! Team SayOne will always encourage all those beginners out there who love to step out into the world of iOS to learn with playground. Learn more about playground and develop your potential with it. Here I’m sharing a link which will help you know more about Playground.

I Need

Help for