Hooking up our UI with IBOutlets

To access our UI elements, we need to connect them to IBOutlets. To do so, perform the following steps:

  1. Open the ExploreCell.swift file in the Navigator panel (or use command + Shift + O, type ExploreCell, and then hit Enter).
  2. Inside of the class declaration, add the following:
@IBOutlet var lblName:UILabel!@IBOutlet var imgExplore:UIImageView!
  1. Open Explore.storyboard and select your exploreCell again using the project Outline.
  2. In the Utilities panel, select the Connection inspector. You should see both variables we just created, lblName and imgExplore, under Outlets:
  1. Click-drag from imgExplore to the ...

Get iOS 12 Programming for Beginners - Third Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.