Swift Book: Playground Secrets & Power Tips


Available via iBooks, Erica’s Playground Secrets & Power Tips takes coding in Xcode playgrounds to a whole new level. I thought I knew my way around pretty well, however, it quickly became clear I was merely skimming the surface.

Exploring and Documenting Playgrounds

After covering the basics of playgrounds and configuring your workspace, Erica dives into working with the editor, including how to make the most of the Sources and Resources folders in a playground.

There is an entire chapter dedicated to documenting playgrounds, which makes for a very effective tool as it relates to teaching Swift. The integration of code and documentation into an interactive environment will bring a whole new experience to learning Swift, hopefully making the language intriguing for even the youngest of techies.

Playground Internals

As with many developers, I’m all about understanding the details of why things do what they do. Chapter 6 fills in the blanks, covering the inner workings of playground files. Understanding at a deeper level allows one to workaround limitations in creative ways. For example, playgrounds do not support custom fonts, however, Erica describes how to use CGFont to load a font into memory from a file URL.

Power Tricks

When it comes to advanced tips and tricks, there’s a full chapter dedicated to the topic. One of the more intriguing discussions is interacting with OS X to access native services (create notifications, change desktop artwork, etc). Erica includes an example of how to create a playground listener that responds to updates from an OS X app. Also of interest is the code snippet demonstrating how to create a QuickLook option for your own classes.

Enter Drawing For A Copy of Playground Secrets & Power Tips

Erica was kind enough to provide 2 copies of her book for the giveaway. You could walk away with your own copy of Playground Secrets & Power Tips by simply subscribing to the Swift Sandbox newsletter. Even better, you will be eligible to win a copy of the other 6 additional Swift books!

Next Week’s Swift Book

If functional programming is on your radar, you’ll want to check back next week…