Now that we have our cell set up, we need to create a file so that we can connect to our cells:
- Right-click on the Explore folder and create a new group called View in the Navigator panel. Then, right-click on View and select New File.
- Inside of the template screen, select iOS at the top, and then Cocoa Touch Class, then hit Next.
- You should now see an options screen. Add the following:
New file:
-
- Class: ExploreCell
- Subclass: UICollectionViewCell
- Also create XIB: Unchecked
- Language: Swift
- Once you hit Next, you are asked to create this file. Select Create and your file should look like mine:
import UIKit
class ExploreCell: UICollectionViewCell {
}
- Open Explore.storyboard and select exploreCell in the Outline view.
- In the Utilities Panel, select the Identity inspector and, under Custom Class, type ExploreCell, then hit Enter.