Get Started with playground

Give the playground a name and choose the platform from the pop-up menu in the dialog that appears. In our case we gonna select ‘ IOS ` and hit create.

We will see playground open with code below.

//: Playground – noun: a place where people can play

import UIKit

var str = "Hello, playground"

We gonna see the above code there as soon we call ‘print’ method we will see the output.

print(str); 

now save the playground.

 

xcode playground hello world
Xcode playground hello world

All set….  BTW playground also runs automatically each time when you finish you finish statement or take a pause from typing. so you can see the output

Leave a Reply

Your email address will not be published. Required fields are marked *