<!--
{
  "availability" : [
    "iOS: 8.0.0 - 17.0.0",
    "iPadOS: 8.0.0 - 17.0.0",
    "macCatalyst: 13.1.0 - 17.0.0",
    "tvOS: -",
    "visionOS: 1.0.0 - 1.0.0"
  ],
  "documentType" : "symbol",
  "framework" : "UIKit",
  "identifier" : "/documentation/UIKit/UIViewController/overrideTraitCollection(forChild:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "UIKit"
    ],
    "preciseIdentifier" : "c:objc(cs)UIViewController(im)overrideTraitCollectionForChildViewController:"
  },
  "title" : "overrideTraitCollection(forChild:)"
}
-->

# overrideTraitCollection(forChild:)

Retrieves the trait collection for a child view controller.

```
func overrideTraitCollection(forChild childViewController: UIViewController) -> UITraitCollection?
```

## Parameters

`childViewController`

The view controller who’s trait collection is to be returned.

## Return Value

The trait collection for the designated view controller.

## Discussion

Use this method to retrieve the trait collection for a child view controller. You can then modify the trait collection for the designated child view controller and set it using the [`setOverrideTraitCollection(_:forChild:)`](/documentation/UIKit/UIViewController/setOverrideTraitCollection(_:forChild:)) method.

---

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)