You can see if everything builds correctly by pressing “Command-B.”

Getting ready to use the libraries we just installed

Before we can load images from Mars, we’ll need a UIImageView. Go over to main.storyboard and add a UIImageView to your ViewController as seen in this GIF:

Now set the constraints so that the UIImageView takes up the whole screen. Click on the “pin” icon and at the top in the four boxes, enter 0 and click on each of the directional margins. Also update the frames as seen in this GIF:

We have a UIImageView, but no way to control it. Create an outlet for it in ViewController.swift called marsPhotoImageView .

You can do this several different ways, but I usually do this by opening the “Assistant Editor” with one screen having Main.storyboard open while the other has ViewController.swift . While holding the “Control” key, click on the UIImageView in main.storyboard and drag the line over to ViewController.swift . Here is another GIF demonstrating how to do that:

The app will grab a picture from Mars taken on the most recent “Earth day” from NASA’s API for the Curiosity Rover and will load that image in our UIImageView.