<!--
{
  "availability" : [
    "iOS: -",
    "iPadOS: -",
    "macCatalyst: -",
    "tvOS: -",
    "visionOS: -"
  ],
  "documentType" : "symbol",
  "framework" : "UIKit",
  "identifier" : "/documentation/UIKit/UITraitEnvironment",
  "metadataVersion" : "0.1.0",
  "role" : "Protocol",
  "symbol" : {
    "kind" : "Protocol",
    "modules" : [
      "UIKit"
    ],
    "preciseIdentifier" : "c:objc(pl)UITraitEnvironment"
  },
  "title" : "UITraitEnvironment"
}
-->

# UITraitEnvironment

A set of methods that makes the iOS interface environment available to your app.

```
@MainActor protocol UITraitEnvironment : NSObjectProtocol
```

## Overview

The system represents the iOS interface environment with *traits*, such as horizontal and vertical size class, display scale, and user interface idiom. You access the trait environment of an object that adopts this protocol with the [`traitCollection`](/documentation/UIKit/UITraitEnvironment/traitCollection) property.

The trait system propagates values from the top of the view hierarchy downward, to every view controller and view in your app. When you modify a trait at any level using trait overrides, that change affects the modified object and all of its descendants. This hierarchical propagation makes it easy to apply configuration changes to entire subtrees of your interface.

For example, setting a trait override on a window scene affects all view controllers and views within that scene. Similarly, setting a trait override on a specific view affects only that view and its subviews.

For more information about how traits propagate through the system, see [Unleash the UIKit trait system](https://developer.apple.com/videos/play/wwdc2023/10057).

## Topics

### Accessing a trait collection

[`traitCollection`](/documentation/UIKit/UITraitEnvironment/traitCollection)

The traits, such as the size class and scale factor, that describe the current environment of the object.

### Responding to a change in the interface environment

[`traitCollectionDidChange(_:)`](/documentation/UIKit/UITraitEnvironment/traitCollectionDidChange(_:))

Reports changes in the iOS interface environment.



---

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)