Creating ItemCell
Create a new Swift file named ItemCell. In ItemCell.swift, define ItemCell as a UITableViewCell subclass.
Listing 10.1 Adding the ItemCell class (ItemCell.swift)
import Foundationimport UIKit class ItemCell: UITableViewCell { }
The easiest way to configure a UITableViewCell subclass is through a storyboard. In Chapter 9, you saw that storyboards for table view controllers have a Prototype Cells section. This is where you will lay out the content for the ItemCell.
Open Main.storyboard and select the UITableViewCell in the document outline. Open its attributes inspector, change the Style to Custom, and change the Identifier to ItemCell.
Now open its identity inspector (the tab). In the Class field, ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access