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

# traitCollection

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

```
var traitCollection: UITraitCollection { get }
```

## Discussion

[`UIViewController`](/documentation/UIKit/UIViewController) and [`UIView`](/documentation/UIKit/UIView) adopt the [`UITraitEnvironment`](/documentation/UIKit/UITraitEnvironment) protocol and expose this property.

> Important:
> Don’t implement this property in your own objects. Instead, use the ``doc://com.apple.uikit/documentation/UIKit/UITraitEnvironment/traitCollection`` property associated with a view, view controller, or other object to determine the currently available trait information.

---

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)