The documentation for UIListContentConfiguration states that I can get the default content configuration of a UICollectionViewCell by getting the cells default content configuration. In practice, however, this presents an error in the compiler:
let choiceRegistration = UICollectionView.CellRegistration<UICollectionViewCell, SurveyItem> { cell, indexPath, item in
cell.configurationUpdateHandler = { cell, state in
switch item.type {
case .choice(let letter, let text):
cell.defaultContentConfiguration()
...
}
The error shown when calling cell.defaultContentConfiguration()
is Value of type 'UICollectionViewCell' has no member 'defaultContentConfiguration'. Instead, I need to initialise a content configuration using UIListContentConfiguration.cell()
to get the default content configuration.
This needs to be reflected in the documentation in UIKit.
The thing to do here is to raise this as a bug so that Apple can update the documentation. You can do so at: https://feedbackassistant.apple.com/
Just mentioning it in a post on the Developer Forums is unlikely to get that change actioned, because we're just random developers like you.