---
title: UIBackgroundConfiguration
framework: uikit
role: symbol
role_heading: Structure
path: uikit/uibackgroundconfiguration-swift.struct
---

# UIBackgroundConfiguration

A configuration that describes a specific background appearance.

## Declaration

```swift
struct UIBackgroundConfiguration
```

## Overview

Overview Background configurations provide a lightweight way for you to create backgrounds for your views. Using a background configuration, you can obtain system default background styling for a variety of different view states. You apply background configurations directly to UIButton or to cells, headers, and footers in UICollectionView and UITableView. To use a background configuration: Create a background configuration with one of the default system styles. Modify the configuration to match your view’s style if you need additional customization. Set the view’s current background configuration to your configuration. var backgroundConfig = UIBackgroundConfiguration.listPlainCell()

// Set a nil background color to use the view's tint color.  backgroundConfig.backgroundColor = nil

cell.backgroundConfiguration = backgroundConfig You can also start by creating an empty background configuration using clear(), which produces a transparent background. Each of the system background styles provides system default values for different configuration states (UIConfigurationState). If you apply a background configuration to a view whose automaticallyUpdatesBackgroundConfiguration property is true, the system automatically updates the background configuration when the view’s state changes. If you want additional customization beyond the system default values, you can choose to manually update the background configuration by overriding the view’s updateConfiguration(using:) method. override func updateConfiguration(using state: UIConfigurationState) {     // Get the system default background configuration for a plain style list cell in the current state.      var backgroundConfig = UIBackgroundConfiguration.listPlainCell().updated(for: state)

// Customize the background color to use the tint color when the cell is highlighted or selected.       if state.isHighlighted || state.isSelected {          backgroundConfig.backgroundColor = nil       }

// Apply the background configuration to the cell.      self.backgroundConfiguration = backgroundConfig  }  When you apply a configuration to a view, UIKit performs the actual drawing and rendering of the background. When you use background configurations instead of rendering your own backgrounds, the system provides automatic view hierarchy management, support for interactive and interruptible animations and transitions, and performance optimizations.

## Topics

### Creating cell background configurations

- [listPlainCell()](uikit/uibackgroundconfiguration-swift.struct/listplaincell().md)
- [listGroupedCell()](uikit/uibackgroundconfiguration-swift.struct/listgroupedcell().md)
- [listSidebarCell()](uikit/uibackgroundconfiguration-swift.struct/listsidebarcell().md)
- [listAccompaniedSidebarCell()](uikit/uibackgroundconfiguration-swift.struct/listaccompaniedsidebarcell().md)

### Creating header and footer background configurations

- [listPlainHeaderFooter()](uikit/uibackgroundconfiguration-swift.struct/listplainheaderfooter().md)
- [listGroupedHeaderFooter()](uikit/uibackgroundconfiguration-swift.struct/listgroupedheaderfooter().md)
- [listSidebarHeader()](uikit/uibackgroundconfiguration-swift.struct/listsidebarheader().md)

### Creating an empty background configuration

- [clear()](uikit/uibackgroundconfiguration-swift.struct/clear().md)

### Customizing the background

- [customView](uikit/uibackgroundconfiguration-swift.struct/customview.md)
- [cornerRadius](uikit/uibackgroundconfiguration-swift.struct/cornerradius.md)
- [backgroundInsets](uikit/uibackgroundconfiguration-swift.struct/backgroundinsets.md)
- [edgesAddingLayoutMarginsToBackgroundInsets](uikit/uibackgroundconfiguration-swift.struct/edgesaddinglayoutmarginstobackgroundinsets.md)
- [backgroundColor](uikit/uibackgroundconfiguration-swift.struct/backgroundcolor.md)
- [backgroundColorTransformer](uikit/uibackgroundconfiguration-swift.struct/backgroundcolortransformer.md)
- [resolvedBackgroundColor(for:)](uikit/uibackgroundconfiguration-swift.struct/resolvedbackgroundcolor(for:).md)
- [visualEffect](uikit/uibackgroundconfiguration-swift.struct/visualeffect.md)
- [shadowProperties](uikit/uibackgroundconfiguration-swift.struct/shadowproperties.md)
- [UIShadowProperties](uikit/uishadowproperties-swift.struct.md)
- [strokeColor](uikit/uibackgroundconfiguration-swift.struct/strokecolor.md)
- [strokeColorTransformer](uikit/uibackgroundconfiguration-swift.struct/strokecolortransformer.md)
- [resolvedStrokeColor(for:)](uikit/uibackgroundconfiguration-swift.struct/resolvedstrokecolor(for:).md)
- [strokeWidth](uikit/uibackgroundconfiguration-swift.struct/strokewidth.md)
- [strokeOutset](uikit/uibackgroundconfiguration-swift.struct/strokeoutset.md)
- [image](uikit/uibackgroundconfiguration-swift.struct/image.md)
- [imageContentMode](uikit/uibackgroundconfiguration-swift.struct/imagecontentmode.md)

### Updating background configurations

- [updated(for:)](uikit/uibackgroundconfiguration-swift.struct/updated(for:).md)

### Type Methods

- [listCell()](uikit/uibackgroundconfiguration-swift.struct/listcell().md)
- [listFooter()](uikit/uibackgroundconfiguration-swift.struct/listfooter().md)
- [listHeader()](uikit/uibackgroundconfiguration-swift.struct/listheader().md)

## Relationships

### Conforms To

- [Copyable](swift/copyable.md)
- [CustomDebugStringConvertible](swift/customdebugstringconvertible.md)
- [CustomReflectable](swift/customreflectable.md)
- [CustomStringConvertible](swift/customstringconvertible.md)
- [Equatable](swift/equatable.md)
- [Escapable](swift/escapable.md)
- [Hashable](swift/hashable.md)
