Book Image

Objective C Memory Management Essentials

Book Image

Objective C Memory Management Essentials

Overview of this book

Table of Contents (18 chapters)
Objective-C Memory Management Essentials
Credits
About the Authors
About the Reviewers
www.PacktPub.com
Preface
Index

Playground for Swift


Apple announced the programming language Swift in 2014 during WWDC and in line with that, Xcode 6 comes with a new feature called Playground where you can have an interactive work area to write Swift code and get live feedback in Xcode. This makes writing Swift code simple and fun as you can input in a single line of code and see the results immediately. And if your code iterates through a loop, you can see its movement via the timeline assistant. The timeline assistant also displays your variables in a graph and draws each step when a view is composed. To give you a better understanding of playground, let's try it out via a simple project:

  1. To start off, we need to create a new playground by selecting the File | New | Playground menu and then giving our playground a name as you can see here. For this project, let's call our playground project MyPlayground:

  2. Next, a screen will appear where you can enter Swift code and the results will be shown instantly on the right side...