After a user selects a photo to use, we present the user with a screen, which contains that image. In the following image, we have a scroller, also known as a UIScrollView
, which allows us to create content that scrolls either horizontally or vertically. The UIScrollView
displays an image (thumbnail) with the filter applied to it as well as the name of the filter. This image and name represent our filters visually to our users.
When the user taps on the image, the user sees the selected filter change the primary image. Let's look at an example:
We are now going to create the elements inside the UIScrollView
. Since we have created a lot inside storyboard, let's create the PhotoItem
entirely in code:
- Right-click the
Review
folder and selectNew File
. - Inside the
Choose a template for your new file
screen, selectiOS
at the top, and thenSwift File
. Then, hitNext
. - Name this file
PhotoItem
and hitCreate
. - Update your file to the following:
import UIKit class PhotoItem...