UITableView Research Flashcards

1
Q

The UITableView Data Source is a ________ that [does what], and is responsible for _________.

A

The UITableView Data Source is a Protocol that provides the methods we need to setup a TableView properly, and is responsible for configuring cells.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

What is a DataSource?

A

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. )

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

True or False: Our DataSource IS the JSON data, or model objects.

A

False – Our DataSource is NOT the JSON data, or model objects.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

Where is our DataSource, generally?

A

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.)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

What is the UITableView Delegate responsible for?

Hint: There are 3 answers.

A

The UITableView Delegate is a protocol responsible for:

  • Managing cell selection
  • Managing table and cell dimensions
  • Managing cell accessories interaction
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

What does the UITableView Delegate protocol do?

A

Provides us with methods we need to operate a TableView

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

IndexPath: What is it?

A

Tells us where in our TableView a certain cell is located.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

True or False:

IndexPath contains both the section and row properties.

A

True.

Ex: A cell’s IndexPath might tell us for instance that a cell is in section 0 at row 5.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

Why is an IndexPath important?

A

This is important for looping through cells in order to display information among other things.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

Important Protocol Methods:

cellForRowAt

A

Responsible for cell creation and recycling

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

Important Protocol Methods:

numberOfRowsInSection

A

Tells the tableView how many cells it has

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

Important Protocol Methods:

didSelectRowAt

A

A specified cell was tapped

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

Important Protocol Methods:

accessoryButtonTappedForRowWithIndexPath

A

An Accessory button was tapped

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

UITableViews are made up of what?

A

A collection of UITableViewCells

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

What are cells type defined by?

A

Identifiers

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

Default Cell Components are:

Hint: 2 answers

A
  • The Cell Content Area

- Accessory View

17
Q

What makes up the Cell Content Area?

A
  • imageView – Always appears on the left before any label
  • textLabel – Basic text label, left aligned
  • detailTextLabel – Secondary text label, position based on style
18
Q

UITableViewCellStyle.Default

A

Text label (black and left-aligned), image view is optional

19
Q

UITableViewCellStyle.Value1

A

Text label (black and left-aligned), detail text label (blue and right-aligned).

20
Q

UITableViewCellStyle.Value2

A

Text label (blue and right-aligned), detail text label (black and left-aligned).

21
Q

UITableViewCellStyle.Subtitle

A

Text label (black and left-aligned, top of cell), detail text label (grey and left-aligned, bottom of cell, smaller text).

22
Q

Accessory Views:

case none

A

The cell does not have any accessory view. This is the default value.

23
Q

Accessory Views:

case disclosureIndicator

A

The cell has an accessory control shaped like a chevron. This control indicates that tapping the cell triggers a push action. The control does not track touches.

24
Q

Accessory Views:

case detailDisclosureButton

A

The cell has an info button and a chevron image as content. This control indicates that tapping the cell allows the user to configure the cell’s contents. The control tracks touches.

25
Q

Accessory Views:

case checkmark

A

The cell has a check mark in its right side. This control does not track touches. The delegate of the table view can manage check marks in a section of rows (possibly limiting the check mark to one row of the section) in its tableView(_:didSelectRowAt:) method.

26
Q

Accessory Views:

case detailButton

A

The cell has an info button without a chevron. This control indicates that tapping the cell displays additional information about the cell’s contents. The control tracks touches.