UIListContentConfiguration
A content configuration for a list-based content view.
Declaration
@interface UIListContentConfiguration : NSObjectOverview
A list content configuration describes the styling and content for an individual element that might appear in a list, like a cell, header, or footer. Using a list content configuration, you can obtain system default styling for a variety of different view states. You fill the configuration with your content, and then assign it directly to cells, headers, and footers in UICollectionView and UITableView, or to your own custom list content view (UIListContentView).
For views like cells, headers, and footers, use their defaultContentConfiguration to get a list content configuration that has preconfigured default styling. Alternatively, you can create a list content configuration from one of the system default styles. After you get the configuration, you assign your content to it, customize any other properties, and assign it to your view as the current content configuration.
UIListContentConfiguration *content = [cell defaultContentConfiguration];
// Configure content.
[content setImage:[UIImage systemImageNamed:@"star"]];
[content setText:@"Favorites"];
// Customize appearance.
[content.imageProperties setTintColor:[UIColor purpleColor]];
[cell setContentConfiguration:content];Topics
Creating default cell configurations
cellConfigurationsubtitleCellConfigurationvalueCellConfigurationsidebarCellConfigurationsidebarSubtitleCellConfigurationaccompaniedSidebarCellConfigurationaccompaniedSidebarSubtitleCellConfiguration
Creating header and footer configurations
plainHeaderConfigurationplainFooterConfigurationgroupedHeaderConfigurationgroupedFooterConfigurationprominentInsetGroupedHeaderConfigurationextraProminentInsetGroupedHeaderConfigurationsidebarHeaderConfiguration
Customizing content
Customizing appearance
imagePropertiestextPropertiessecondaryTextPropertiesUIListContentImagePropertiesUIListContentTextProperties
Customizing layout
axesPreservingSuperviewLayoutMarginsdirectionalLayoutMarginsprefersSideBySideTextAndSecondaryTextimageToTextPaddingtextToSecondaryTextHorizontalPaddingtextToSecondaryTextVerticalPadding