<!--
{
  "availability" : [
    "macOS: 10.15.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "AppKit",
  "identifier" : "/documentation/AppKit/NSCollectionLayoutSize",
  "metadataVersion" : "0.1.0",
  "role" : "Class",
  "symbol" : {
    "kind" : "Class",
    "modules" : [
      "AppKit"
    ],
    "preciseIdentifier" : "c:objc(cs)NSCollectionLayoutSize"
  },
  "title" : "NSCollectionLayoutSize"
}
-->

# NSCollectionLayoutSize

The width and the height of an item in a collection view.

```
@MainActor class NSCollectionLayoutSize
```

## Overview

A size is a pair of dimensions ([`NSCollectionLayoutDimension`](/documentation/AppKit/NSCollectionLayoutDimension)): a width dimension and a height dimension. Every component of a collection view layout has an explicit size.

## Topics

### Creating a layout size

[`+  sizeWithWidthDimension:heightDimension:`](/documentation/AppKit/NSCollectionLayoutSize/init(widthDimension:heightDimension:))

Creates a size with the specified width and height dimensions.

### Getting the width and height

[`widthDimension`](/documentation/AppKit/NSCollectionLayoutSize/widthDimension)

The width dimension of an item in a collection view layout.

[`heightDimension`](/documentation/AppKit/NSCollectionLayoutSize/heightDimension)

The height dimension of an item in a collection view layout.

## Relationships

### Conforms To

[`CustomDebugStringConvertible`](/documentation/Swift/CustomDebugStringConvertible)

[`Hashable`](/documentation/Swift/Hashable)

[`Equatable`](/documentation/Swift/Equatable)

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

[`CVarArg`](/documentation/Swift/CVarArg)

[`CustomStringConvertible`](/documentation/Swift/CustomStringConvertible)

[`NSCopying`](/documentation/Foundation/NSCopying)

[`Sendable`](/documentation/Swift/Sendable)

### Inherits From

[`NSObject-swift.class`](/documentation/ObjectiveC/NSObject-swift.class)

---

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)