UITableView

Reuse

Why? Memory. Allows you to have a table with thousands of cells without having thousands of cell objects in memory

UITableViewCell

Styles

(IB -> enum)

Concepts

Mutation

Add

tableView.insertRows(at: [indexPath], with: .automatic)

Move

override func tableView(_ tableView: UITableView,
                        moveRowAt sourceIndexPath: IndexPath,
                        to destinationIndexPath: IndexPath) {
    // change in underlying data
}

Delete

override func tableView(_ tableView: UITableView,
                        commit editingStyle: UITableViewCell.EditingStyle,
                        forRowAt indexPath: IndexPath) {
    if editingStyle == .delete {
        // change in underlying data
    }
}