Setting up restaurant list cell outlets
Now, we need to set up our restaurantListCell
outlets:
Open the
RestaurantCell.swift
file in the Navigator panel (or click on CMD + SHIFT + O, typeRestaurantCell
, and hit Enter).Inside the class declaration, add the following:
@IBOutlet var lblTitle:UILabel! @IBOutlet var lblCity:UILabel! @IBOutlet var lblCuisine:UILabel!
Open
Explore.storyboard
and select ourrestaurantListCell
again in the Outline view.Then, in the Utilities panel, select the Connections Inspector, where you will see a list of Outlets.
Click on and drag from the empty circle
lblTitle
under Outlets to the topmost label in ourrestaurantListCell
, from the empty circlelblCity
to the middle label in our cell and from the empty circlelblCuisine
to the last label in our cell:
Now that we have our restaurantListCell
outlets set up, let's get some data into our cell. We previously created our RestaurantItem.swift
file; we will use this in our restaurant list.
Creating RestaurantDataManager
Let...