Chapter 19: UITableViewCell.detailTextLabel is deprecated

I found that the .detailTextLabel property is deprecated.

https://developer.apple.com/documentation/uikit/uitableviewcell/1623273-detailtextlabel

Please update the book.

Hi,

Deprecation does not mean that you cannot still use detailTextLabel :slight_smile: In fact, given how widely used it is, it will probably be around for a few more years. But it will not receive any additional features and Apple will probably concentrate on the new mechanism for creating table view cells for all updates/feature enhancements.

If you are interested to learn more about the new mechanism, you can read about it here:

The next version of the book will have this updated approach.

1 Like

Thank you very much for your answer.

I think I have new question instead.
After I follow the step in chapter 19 until I encounter with this line

cell.detailTextLabel!.text = "\(checklist.countUncheckedItems()) Remaining"

I got an error.

**Fatal error: Unexpectedly found nil while unwrapping an Optional value: file Checklists/AllListsViewController.swift, line 55**

That’s why I try to get rid of the error by using new API. Please help.

Ah! I found an error. I forgot to delete this line out from viewDidLoad

override func viewDidLoad() {
    super.viewDidLoad()
this line >>>    tableView.register(UITableViewCell.self, forCellReuseIdentifier: cellIdentifier) 
}

I guess. I always get the same cell that is not a .subtitle style.