UITableView Research Flashcards
The UITableView Data Source is a ________ that [does what], and is responsible for _________.
The UITableView Data Source is a Protocol that provides the methods we need to setup a TableView properly, and is responsible for configuring cells.
What is a DataSource?
A DataSource is the object where all of the data that we want to display is held.
( Hint: If we are trying to display an Array of “Customers” that is located in our “ViewController”, then our DataSource is our ViewController. )
True or False: Our DataSource IS the JSON data, or model objects.
False – Our DataSource is NOT the JSON data, or model objects.
Where is our DataSource, generally?
Generally, our data source is where we have a collection of model objects.
(Tip: So far, this has been in our ViewController, but it doesn’t have to be.)
What is the UITableView Delegate responsible for?
Hint: There are 3 answers.
The UITableView Delegate is a protocol responsible for:
- Managing cell selection
- Managing table and cell dimensions
- Managing cell accessories interaction
What does the UITableView Delegate protocol do?
Provides us with methods we need to operate a TableView
IndexPath: What is it?
Tells us where in our TableView a certain cell is located.
True or False:
IndexPath contains both the section and row properties.
True.
Ex: A cell’s IndexPath might tell us for instance that a cell is in section 0 at row 5.
Why is an IndexPath important?
This is important for looping through cells in order to display information among other things.
Important Protocol Methods:
cellForRowAt
Responsible for cell creation and recycling
Important Protocol Methods:
numberOfRowsInSection
Tells the tableView how many cells it has
Important Protocol Methods:
didSelectRowAt
A specified cell was tapped
Important Protocol Methods:
accessoryButtonTappedForRowWithIndexPath
An Accessory button was tapped
UITableViews are made up of what?
A collection of UITableViewCells
What are cells type defined by?
Identifiers