UITableView detailTextLabel equivalent in UIListContentConfiguration

I see there is a deprecation warning when using detailTextLabel of UITableViewCell.

   @available(iOS, introduced: 3.0, deprecated: 100000, message: "Use UIListContentConfiguration instead, this property will be deprecated in a future release.")
    open var detailTextLabel: UILabel? { get } // default is nil.  label will be created if necessary (and the current style supports a detail label).

But it is not clear how to use UIListContentConfiguration to support detailTextLabel that is on the right side of the cell. I only see secondaryText in UIListContentConfiguration that is always displayed as a subtitle. How does one use UIListContentConfiguration as a replacement?

You're right, doc is really useless to help converting code or to explain how to properly use it. As usual when dealing with deprecation, nightmarish.

That's a long standing request to provide clear information for deprecated API replacement: https://developer.apple.com/forums/thread/127216

In your case, if detailTextLabel is on the right, does it mean you have a cell with its own xib ? Or do you use detailTextLabel to set the frame ? In fact, it seems it is no more possible to access to the UILabels (in standard cells).

Then you don't use UIListContentConfiguration which are for standard cells (unless you subclass UIListContentConfiguration).

Interesting explanation in this post. https://developer.apple.com/forums/thread/657873

When using UIListContentConfiguration, you use the valueCell() constructor (documentation) to get a configuration similar to the .value1 style UITableViewCell layout.

If the UITableViewCell was initialized with .value1 style, then calling defaultContentConfiguration() on it will return a valueCell() style UIListContentConfiguration, so you don't even need to use the constructor directly.

A valueCell() configuration will have the prefersSideBySideTextAndSecondaryText property (documentation) enabled by default, so that the primary and secondary text will sit side-by-side on the same line when there's enough space to fit both next to each other. (If there's too much text to fit in the horizontal space available, then the labels will automatically stack vertically instead to avoid truncation.)

UITableView detailTextLabel equivalent in UIListContentConfiguration
 
 
Q