XCode 6: How To Add Image Assets To Your Playground

As I mentioned earlier today at the Swift Hack Day,  the new Playground files in XCode 6 are one of those things that I didn’t know I needed, but now can’t live without. I like to experiment in Playgrounds a lot, and that includes playing with images.

Let’s take as an example my Minion Mayhem Playground, where I create a tableView of Minions:

Minions Table View

Each Playground comes with a Resources folder. That is where you keep your images. There are two ways to get to this Resources folder:

File Inspector

In the XCode menu just select View -> Utilities -> Show File Inspector:

XCode File Inspector

You’ll see a panel on the right hand side. The Playground Settings section will have your path to the Resource folder. Just click the little arrow, and open up the Resource folder!

Playground Resources

Now just add your images in the Resources folder, and code away!

Package Contents

The other way to get to the Resources is to right click on your Playground file in Finder, and select the Show Package Contents option:

Show Package Contents

You can now see the Resources folder:

Playground Resources

Once you got all your images into your Resources folder, it’s time to play!

NatashaTheRobot Playground

Enjoy the article? Join over 14,500+ Swift developers and enthusiasts who get my weekly updates.