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

# UIMutableTraits

A mutable container of traits.

```
@protocol UIMutableTraits <NSObject>
```

## Overview

The [`UIMutableTraits`](/documentation/UIKit/UIMutableTraits-8l00o) protocol provides read-write access to get and set trait values on an underlying container. UIKit uses this protocol to facilitate working with instances of [`UITraitCollection`](/documentation/UIKit/UITraitCollection), which are immutable and read-only. The [`UITraitCollection`](/documentation/UIKit/UITraitCollection) initializer [`traitCollectionWithTraits:`](/documentation/UIKit/UITraitCollection/traitCollectionWithTraits:) uses an instance of [`UIMutableTraits`](/documentation/UIKit/UIMutableTraits-8l00o), which enables you to set a batch of trait values in one method call. [`UITraitOverrides`](/documentation/UIKit/UITraitOverrides-c.protocol) conforms to [`UIMutableTraits`](/documentation/UIKit/UIMutableTraits-8l00o), making it easy to set trait overrides on trait environments such as views and view controllers.

## Topics

### Getting and setting trait values

[`@property (nonatomic) UIAccessibilityContrast accessibilityContrast;`](/documentation/UIKit/UIMutableTraits-8l00o/accessibilityContrast)

The accessibility contrast associated with the current environment.

[`@property (nonatomic) UIUserInterfaceActiveAppearance activeAppearance;`](/documentation/UIKit/UIMutableTraits-8l00o/activeAppearance)

A property that indicates whether a scene has an active appearance.

[`@property (nonatomic) UIDisplayGamut displayGamut;`](/documentation/UIKit/UIMutableTraits-8l00o/displayGamut)

The gamut of the current display.

[`@property (nonatomic) CGFloat displayScale;`](/documentation/UIKit/UIMutableTraits-8l00o/displayScale)

The display scale of the trait collection.

[`@property (nonatomic) UIForceTouchCapability forceTouchCapability;`](/documentation/UIKit/UIMutableTraits-8l00o/forceTouchCapability)

The Force Touch capability value of the trait collection.

[`@property (nonatomic) UIUserInterfaceSizeClass horizontalSizeClass;`](/documentation/UIKit/UIMutableTraits-8l00o/horizontalSizeClass)

The horizontal size class of the trait collection.

[`@property (nonatomic) UIImageDynamicRange imageDynamicRange;`](/documentation/UIKit/UIMutableTraits-8l00o/imageDynamicRange)

The image dynamic range associated with the current environment.

[`@property (nonatomic) UITraitEnvironmentLayoutDirection layoutDirection;`](/documentation/UIKit/UIMutableTraits-8l00o/layoutDirection)

The layout direction associated with the current environment.

[`@property (nonatomic) UILegibilityWeight legibilityWeight;`](/documentation/UIKit/UIMutableTraits-8l00o/legibilityWeight)

The font weight to apply to text.

[`@property (nonatomic) UIListEnvironment listEnvironment;`](/documentation/UIKit/UIMutableTraits-8l00o/listEnvironment)

The style of the containing list in a collection view or table view.

[`@property (nonatomic, copy) UIContentSizeCategory preferredContentSizeCategory;`](/documentation/UIKit/UIMutableTraits-8l00o/preferredContentSizeCategory)

The font sizing option preferred by the user.

[`@property (nonatomic) BOOL resolvesNaturalAlignmentWithBaseWritingDirection;`](/documentation/UIKit/UIMutableTraits-8l00o/resolvesNaturalAlignmentWithBaseWritingDirection)

The setting for whether the system resolves natural alignment with base writing direction for the current environment.

[`@property (nonatomic) UISceneCaptureState sceneCaptureState;`](/documentation/UIKit/UIMutableTraits-8l00o/sceneCaptureState)

The scene capture state for the current environment.

[`@property (nonatomic) UISplitViewControllerLayoutEnvironment splitViewControllerLayoutEnvironment;`](/documentation/UIKit/UIMutableTraits-8l00o/splitViewControllerLayoutEnvironment)

The split view controller layout for the current environment.

[`@property (nonatomic) UITabAccessoryEnvironment tabAccessoryEnvironment;`](/documentation/UIKit/UIMutableTraits-8l00o/tabAccessoryEnvironment)

The tab accessory environment for the current trait collection.

[`@property (nonatomic) UINSToolbarItemPresentationSize toolbarItemPresentationSize;`](/documentation/UIKit/UIMutableTraits-8l00o/toolbarItemPresentationSize)

The presentation size of a toolbar item in an AppKit toolbar.

[`@property (nonatomic, copy) NSString * typesettingLanguage;`](/documentation/UIKit/UIMutableTraits-8l00o/typesettingLanguage)

The typesetting language associated with the current environment.

[`@property (nonatomic) UIUserInterfaceIdiom userInterfaceIdiom;`](/documentation/UIKit/UIMutableTraits-8l00o/userInterfaceIdiom)

The user interface idiom of the trait collection.

[`@property (nonatomic) UIUserInterfaceLevel userInterfaceLevel;`](/documentation/UIKit/UIMutableTraits-8l00o/userInterfaceLevel)

The elevation level of the interface.

[`@property (nonatomic) UIUserInterfaceStyle userInterfaceStyle;`](/documentation/UIKit/UIMutableTraits-8l00o/userInterfaceStyle)

The style associated with the user interface.

[`@property (nonatomic) UIUserInterfaceSizeClass verticalSizeClass;`](/documentation/UIKit/UIMutableTraits-8l00o/verticalSizeClass)

The vertical size class of the trait collection.

### Getting and setting trait data

[`- (id<NSObject>) objectForTrait:(UIObjectTrait) trait;`](/documentation/UIKit/UIMutableTraits-8l00o/objectForTrait:)

[`- (void) setObject:(id<NSObject>) object forTrait:(UIObjectTrait) trait;`](/documentation/UIKit/UIMutableTraits-8l00o/setObject:forTrait:)

[`typedef Class<UIObjectTraitDefinition> * UIObjectTrait;`](/documentation/UIKit/UIObjectTrait)

[`- (CGFloat) valueForCGFloatTrait:(UICGFloatTrait) trait;`](/documentation/UIKit/UIMutableTraits-8l00o/valueForCGFloatTrait:)

[`- (void) setCGFloatValue:(CGFloat) value forTrait:(UICGFloatTrait) trait;`](/documentation/UIKit/UIMutableTraits-8l00o/setCGFloatValue:forTrait:)

[`typedef Class<UICGFloatTraitDefinition> * UICGFloatTrait;`](/documentation/UIKit/UICGFloatTrait)

[`- (NSInteger) valueForNSIntegerTrait:(UINSIntegerTrait) trait;`](/documentation/UIKit/UIMutableTraits-8l00o/valueForNSIntegerTrait:)

[`- (void) setNSIntegerValue:(NSInteger) value forTrait:(UINSIntegerTrait) trait;`](/documentation/UIKit/UIMutableTraits-8l00o/setNSIntegerValue:forTrait:)

[`typedef Class<UINSIntegerTraitDefinition> * UINSIntegerTrait;`](/documentation/UIKit/UINSIntegerTrait)

### Bridging traits

[`protocol UITraitBridgedEnvironmentKey`](/documentation/UIKit/UITraitBridgedEnvironmentKey)

### Instance Properties

[`@property (nonatomic) BOOL systemPrefersReducedResourceUsage;`](/documentation/UIKit/UIMutableTraits-8l00o/systemPrefersReducedResourceUsage)

## Relationships

### Inherited By

[`UITraitOverrides-c.protocol`](/documentation/UIKit/UITraitOverrides-c.protocol)

### Inherits From

[`NSObjectProtocol`](/documentation/ObjectiveC/NSObjectProtocol)

---

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)