<!--
{
  "availability" : [
    "iOS: 14.0.0 -",
    "iPadOS: 14.0.0 -",
    "macCatalyst: -",
    "tvOS: 14.0.0 -",
    "visionOS: -"
  ],
  "documentType" : "symbol",
  "framework" : "UIKit",
  "identifier" : "/documentation/UIKit/UIViewConfigurationState-swift.struct",
  "metadataVersion" : "0.1.0",
  "role" : "Structure",
  "symbol" : {
    "kind" : "Structure",
    "modules" : [
      "UIKit"
    ],
    "preciseIdentifier" : "s:5UIKit24UIViewConfigurationStateV"
  },
  "title" : "UIViewConfigurationState"
}
-->

# UIViewConfigurationState

A structure that encapsulates a view’s state.

```
struct UIViewConfigurationState
```

## Overview

A view configuration state encompasses a trait collection along with all of the common states that affect a view’s appearance — states like selected, focused, or disabled. A view configuration state encapsulates the inputs that configure a view for any possible state or combination of states. You use a view configuration state with background and content configurations to obtain the default appearance for a specific state.

Typically, you don’t create a configuration state yourself. To obtain a configuration state, override the [`updateConfiguration(using:)`](/documentation/UIKit/UICollectionViewCell/updateConfiguration(using:)) method in your view subclass and use the state parameter. Outside of this method, you can get a view’s configuration state by using its [`configurationState`](/documentation/UIKit/UICollectionViewCell/configurationState-4u37h) property.

You can create your own custom states to add to a view configuration state by defining a custom state key using [`UIConfigurationStateCustomKey`](/documentation/UIKit/UIConfigurationStateCustomKey).

## Topics

### Managing view configuration states

[`var isSelected: Bool`](/documentation/UIKit/UIViewConfigurationState-swift.struct/isSelected)

A Boolean value that indicates whether the view is in a selected state.

[`var isHighlighted: Bool`](/documentation/UIKit/UIViewConfigurationState-swift.struct/isHighlighted)

A Boolean value that indicates whether the view is in a highlighted state.

[`var isFocused: Bool`](/documentation/UIKit/UIViewConfigurationState-swift.struct/isFocused)

A Boolean value that indicates whether the view is in a focused state.

[`var isDisabled: Bool`](/documentation/UIKit/UIViewConfigurationState-swift.struct/isDisabled)

A Boolean value that indicates whether the view is in a disabled state.

[`var isPinned: Bool`](/documentation/UIKit/UIViewConfigurationState-swift.struct/isPinned)

A Boolean value that indicates whether the view is in a pinned state.

## Relationships

### Conforms To

[`Equatable`](/documentation/Swift/Equatable)

[`Hashable`](/documentation/Swift/Hashable)

[`Escapable`](/documentation/Swift/Escapable)

[`CustomReflectable`](/documentation/Swift/CustomReflectable)

[`CustomDebugStringConvertible`](/documentation/Swift/CustomDebugStringConvertible)

[`Copyable`](/documentation/Swift/Copyable)

[`CustomStringConvertible`](/documentation/Swift/CustomStringConvertible)

[`UIConfigurationState-8d7pd`](/documentation/UIKit/UIConfigurationState-8d7pd)

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)