Trying to Apply Content Configuration on a UICollectionReusableView

I was trying to register a UICollectionReusableView in my UICollectionView.SupplementaryRegistration handler in order to apply a content configuration to apply the text and secondaryText properties to the reusable view. However, when I try to apply the content configuration on the header view object that I return in my cell registration handler, I get an error that says: "Value of type 'UICollectionReusableView' has no member 'contentConfiguration'".

How can apply content configuration to a UICollectionReusableView?

This is my code:

        let headerRegistration = UICollectionView.SupplementaryRegistration<UICollectionReusableView>(elementKind: UICollectionView.elementKindSectionHeader) { header, elementKind, indexPath in
            // Header configuration is handled in the header's init
            var configuration = UIListContentConfiguration.plainHeader()
            
            configuration.text = "Current Emotional State"
            configuration.secondaryText = "What best describes how you're feeling right now?"
            
            header.contentConfiguration = configuration 
        }

UICollectionReusableView has no property called contentConfiguration. Rather than use UICollectionReusableView as the cell type in the supplementary registration, I used UICollectionViewCell. I also used the API for the UIListContentConfiguration to modify the appearance of the text of the primary and secondary titles to get the larger appearance of the header that I want and the contrast in the text colours of the primary and secondary labels. My code looks like this now:

        let headerRegistration = UICollectionView.SupplementaryRegistration<UICollectionViewCell>(elementKind: UICollectionView.elementKindSectionHeader) { header, elementKind, indexPath in
            // Header configuration is handled in the header's init
            var configuration = UIListContentConfiguration.plainHeader()
            
            configuration.text = "Current Emotional State"
            configuration.textProperties.font = .systemFont(ofSize: 20, weight: .medium)
            configuration.textProperties.color = .label
            
            configuration.secondaryText = "What best describes how you're feeling right now?"
            configuration.secondaryTextProperties.font = .systemFont(ofSize: 17, weight: .regular)
            
            header.contentConfiguration = configuration
        }
Trying to Apply Content Configuration on a UICollectionReusableView
 
 
Q