O'Reilly logo

Mastering Swift 4 - Fourth Edition by Jon Hoffman

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Showing images in a Playground

Playgrounds are great at showing the results of code as text in the results sidebar; however; they can also do a lot more than just work with text. We can display other items such as images and graphs. Let's look at how we would show an image in a Playground. The first thing we need to do is to load the image into the resource directory of our Playground.

The following steps show how to load an image into the resource directory:

  1. Let's begin by showing the project navigator sidebar. To do this, in the top menu bar, navigate to View | Navigators | Show Project Navigator or use the command + 1 keyboard shortcut. The project navigator looks similar to this:
  1. Once we have the Project Navigator open, we can drag ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required