Setting up our View Controllers 

When we set up our structure, we created a View Controller with a label that says Review. This was done just to see the structure, but we removed the button tapping to the review controller. We currently have two buttons on our Restaurant Detail page: Add Photo and Add Review. Both of these buttons need to have View Controllers connected to them. Our Add Photo hooks up to a View Controller where we launch the user's camera and our Add Review hooks up to a static tableview.

Let's work on the Add Photo button first:

  1. Open the Main.storyboard and find the View Controller that has the label Reviews and delete the label.
  2. Select the View Controller, then navigate to Editor | Embed In | Navigation Controller. This View Controller will now be our Photo Filter View Controller.
  3. In the Restaurant Detail View, find the Table View Cell that contains the Add Photo label and button.
  4. Open up the disclosure arrows and Ctrl + drag from the button that we placed inside the container to the Navigation controller we just added; under Action Segue, select Present Modally.

Next, let's set up this View Controller. Before we start setting up let's talk about what needs to be done next. In this controller, we want the user to be able to take a picture or pick a photo from their Photos app and add it. Once they select the photo, we want them to be able to apply a filter to their photo and then save it to the device. This view needs two primary things: a way to scroll the filter items and an image that displays the selected photo and filter. We could use a scroll view to do this, but later in the book we want to add drag and drop to the iPad, so collection view is the easier way. Now that you have a better idea of the direction, let's set up our UI.