<!--
{
  "availability" : [
    "iOS: 6.0.0 -",
    "iPadOS: 6.0.0 -",
    "macCatalyst: 13.1.0 -",
    "macOS: 10.8.0 -",
    "tvOS: 9.0.0 -",
    "visionOS: 1.0.0 -",
    "watchOS: 2.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "Foundation",
  "identifier" : "/documentation/Foundation/ByteCountFormatter/allowedUnits",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Property",
  "symbol" : {
    "kind" : "Instance Property",
    "modules" : [
      "Foundation"
    ],
    "preciseIdentifier" : "c:objc(cs)NSByteCountFormatter(py)allowedUnits"
  },
  "title" : "allowedUnits"
}
-->

# allowedUnits

Specify the units that can be used in the output.

```
var allowedUnits: ByteCountFormatter.Units { get set }
```

## Discussion

If the value is [`NSByteCountFormatterUseDefault`](/documentation/Foundation/NSByteCountFormatterUnits/NSByteCountFormatterUseDefault), the formatter uses platform-appropriate settings; otherwise will only the specified units are used.

[`ByteCountFormatter.Units`](/documentation/Foundation/ByteCountFormatter/Units) values can be combined using the C `OR` operator to specify complex formatting strings. The [`NSByteCountFormatterUseDefault`](/documentation/Foundation/NSByteCountFormatterUnits/NSByteCountFormatterUseDefault) or [`useAll`](/documentation/Foundation/ByteCountFormatter/Units/useAll) constants can be used with the C `AND` or the C `NOT` operators to create custom formats as well.

This is the default value if [`NSByteCountFormatterUseDefault`](/documentation/Foundation/NSByteCountFormatterUnits/NSByteCountFormatterUseDefault).

> Note:
> ZB and YB cannot be covered by the range of possible values, but you can still choose to use these units to get fractional display (`0.0035 ZB` for instance).

---

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)