Why is a UITableViewCell detailTextLabel optional in Swift, whereas textLabel is not

I think I somehow made a distinction between "?" and "!" in fast language. But while working, I came across something that confused me.

While working with a table view, I found the following data types in UITableViewCell

textLabel and detailTextLabel?

My question is: why is it detailTextLabel?optional, even if textLabel might also be nil?

+1
source share
1 answer

detailTextLabelis optional because it could potentially be zero. Check the documentation :

, nil. UITableViewCellStyle .

, , TextLabel . , .

, textLabel , , :)

+2

Source: https://habr.com/ru/post/1598781/


All Articles