---
title: updateTraitsIfNeeded()
framework: uikit
role: symbol
role_heading: Instance Method
path: uikit/uiviewcontroller/updatetraitsifneeded()
---

# updateTraitsIfNeeded()

Updates traits immediately for this view controller and its view, including any view controllers and views in this subtree.

## Declaration

```swift
func updateTraitsIfNeeded()
```

## Discussion

Discussion The system sends trait change callbacks synchronously.

## See Also

### Overriding trait values

- [traitOverrides](uikit/uiviewcontroller/traitoverrides-1z1cc.md)
- [UITraitOverrides](uikit/uitraitoverrides-swift.struct.md)
