<!--
{
  "availability" : [
    "iOS: 13.0.0 -",
    "iPadOS: 13.0.0 -",
    "macCatalyst: 13.1.0 -",
    "tvOS: 13.0.0 -",
    "visionOS: 1.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "UIKit",
  "identifier" : "/documentation/UIKit/NSCollectionLayoutDimension",
  "metadataVersion" : "0.1.0",
  "role" : "Class",
  "symbol" : {
    "kind" : "Class",
    "modules" : [
      "UIKit"
    ],
    "preciseIdentifier" : "c:objc(cs)NSCollectionLayoutDimension"
  },
  "title" : "NSCollectionLayoutDimension"
}
-->

# NSCollectionLayoutDimension

An individual dimension representing an item’s width or height in a collection view.

```
@MainActor class NSCollectionLayoutDimension
```

## Overview

Each item in a collection view has an explicit width dimension and height dimension, which combine to define the item’s size ([`NSCollectionLayoutSize`](/documentation/UIKit/NSCollectionLayoutSize)).

You can express an item’s dimensions using an absolute, estimated, or fractional value.

Use an *absolute value* to specify exact dimensions, like a 44 x 44 point square:

```swift
let absoluteSize = NSCollectionLayoutSize(widthDimension: .absolute(44),
                                         heightDimension: .absolute(44))
```

Use an *estimated value* if the size of your content might change at runtime, such as when data is loaded or in response to a change in system font size. You provide an initial estimated size and the system computes the actual value later.

```swift
let estimatedSize = NSCollectionLayoutSize(widthDimension: .estimated(200),
                                          heightDimension: .estimated(100))
```

Use a *fractional value* to define a value that’s relative to a dimension of the item’s container. This option simplifies specifying aspect ratios. For example, the following item has a width and a height that are both equal to 20% of its container’s width, creating a square that grows and shrinks as the size of its container changes.

```swift
let fractionalSize = NSCollectionLayoutSize(widthDimension: .fractionalWidth(0.2),
                                           heightDimension: .fractionalWidth(0.2))
```

## Topics

### Creating a dimension

[`absolute(_:)`](/documentation/UIKit/NSCollectionLayoutDimension/absolute(_:))

Creates a dimension with an absolute point value.

[`estimated(_:)`](/documentation/UIKit/NSCollectionLayoutDimension/estimated(_:))

Creates a dimension with an estimated point value.

[`fractionalHeight(_:)`](/documentation/UIKit/NSCollectionLayoutDimension/fractionalHeight(_:))

Creates a dimension that is computed as a fraction of the height of the containing group.

[`fractionalWidth(_:)`](/documentation/UIKit/NSCollectionLayoutDimension/fractionalWidth(_:))

Creates a dimension that is computed as a fraction of the width of the containing group.

[`uniformAcrossSiblings(estimate:)`](/documentation/UIKit/NSCollectionLayoutDimension/uniformAcrossSiblings(estimate:))

Creates a dimension in which each item receives as much room as it requires and grows to match the dimension of its largest sibling.

### Getting the dimension value

[`dimension`](/documentation/UIKit/NSCollectionLayoutDimension/dimension)

The floating-point value of the dimension.

### Getting the dimension type

[`isAbsolute`](/documentation/UIKit/NSCollectionLayoutDimension/isAbsolute)

A Boolean value that indicates whether the dimension is expressed as an absolute value.

[`isEstimated`](/documentation/UIKit/NSCollectionLayoutDimension/isEstimated)

A Boolean value that indicates whether the dimension is expressed as an estimated value.

[`isFractionalHeight`](/documentation/UIKit/NSCollectionLayoutDimension/isFractionalHeight)

A Boolean value that indicates whether the dimension is expressed as a fraction of its container’s height.

[`isFractionalWidth`](/documentation/UIKit/NSCollectionLayoutDimension/isFractionalWidth)

A Boolean value that indicates whether the dimension is expressed as a fraction of its container’s width.

[`isUniformAcrossSiblings`](/documentation/UIKit/NSCollectionLayoutDimension/isUniformAcrossSiblings)

A Boolean value that indicates whether the dimension grows to match the dimension of its largest sibling.



---

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)