Navigating to a Photo

In this section, you are going to add functionality to allow a user to navigate to and display a single photo.

Create a new Swift file named PhotoInfoViewController. In this new file, declare the PhotoInfoViewController class and add an imageView outlet.

i​m​p​o​r​t​ ​F​o​u​n​d​a​t​i​o​ni​m​p​o​r​t​ ​U​I​K​i​tc​l​a​s​s​ ​P​h​o​t​o​I​n​f​o​V​i​e​w​C​o​n​t​r​o​l​l​e​r​:​ ​U​I​V​i​e​w​C​o​n​t​r​o​l​l​e​r​ ​{​

 ​ ​ ​ ​@​I​B​O​u​t​l​e​t​ ​v​a​r​ ​i​m​a​g​e​V​i​e​w​:​ ​U​I​I​m​a​g​e​V​i​e​w​!}

Now set up the interface for this view controller. Open Main.storyboard and drag a new View Controller onto the canvas from the object library. With this view controller selected, open its identity inspector and change ...

Get iOS Programming: The Big Nerd Ranch Guide now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.