<!--
{
  "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/NSCollectionLayoutSection",
  "metadataVersion" : "0.1.0",
  "role" : "Class",
  "symbol" : {
    "kind" : "Class",
    "modules" : [
      "UIKit"
    ],
    "preciseIdentifier" : "c:objc(cs)NSCollectionLayoutSection"
  },
  "title" : "NSCollectionLayoutSection"
}
-->

# NSCollectionLayoutSection

A container that combines a set of groups into distinct visual groupings.

```
@MainActor class NSCollectionLayoutSection
```

## Overview

A collection view layout has one or more sections. Sections provide a way to separate the layout into distinct pieces.

Each section can have the same layout or a different layout than the other sections in the collection view. A section’s layout is determined by the properties of the group ([`NSCollectionLayoutGroup`](/documentation/UIKit/NSCollectionLayoutGroup)) that’s used to create the section.

In the Photos app, each section in the Years page uses the same layout. In the App Store, the Apps page displays several sections with different content arrangements.

![Schematic representation of the App Store app on iOS, showing a collection view with a compositional layout. The layout is composed of two horizontally-scrolling sections that have different layouts. The top section shows one group with one item visible onscreen, with other groups peeking in from the sides of the screen. The bottom section shows one group that’s a column of three cells, each of those cells being an item. The two different sections are highlighted and labeled as sections.](images/com.apple.uikit/media-3568661@2x.png)

Each section can have its own background, header, and footer to distinguish it from other sections.

## Topics

### Creating a section

[`init(group:)`](/documentation/UIKit/NSCollectionLayoutSection/init(group:))

Creates a section containing the specified group.

[`list(using:layoutEnvironment:)`](/documentation/UIKit/NSCollectionLayoutSection/list(using:layoutEnvironment:))

Creates a list section with the specified list configuration and layout environment.

[`sectionWithListConfiguration:layoutEnvironment:`](/documentation/UIKit/NSCollectionLayoutSection/sectionWithListConfiguration:layoutEnvironment:)

Creates a list section with the specified list configuration and layout environment.

[`orthogonalLayoutSectionForMediaItems()`](/documentation/UIKit/NSCollectionLayoutSection/orthogonalLayoutSectionForMediaItems())

Creates an orthogonally scrolling section with system default spacing.

### Specifying scrolling behavior

[`orthogonalScrollingBehavior`](/documentation/UIKit/NSCollectionLayoutSection/orthogonalScrollingBehavior)

The section’s scrolling behavior in relation to the main layout axis.

[`orthogonalScrollingProperties`](/documentation/UIKit/NSCollectionLayoutSection/orthogonalScrollingProperties)

The section’s orthogonal scrolling properties.

[`UICollectionLayoutSectionOrthogonalScrollingProperties`](/documentation/UIKit/UICollectionLayoutSectionOrthogonalScrollingProperties)

An object that specifies properties for a layout section that scrolls orthogonally in relation to the main layout axis.

### Configuring section spacing

[`interGroupSpacing`](/documentation/UIKit/NSCollectionLayoutSection/interGroupSpacing)

The amount of space between the groups in the section.

[`contentInsets`](/documentation/UIKit/NSCollectionLayoutSection/contentInsets)

The amount of space between the content of the section and its boundaries.

[`contentInsetsReference`](/documentation/UIKit/NSCollectionLayoutSection/contentInsetsReference)

The boundary to reference when defining content insets.

[`supplementaryContentInsetsReference`](/documentation/UIKit/NSCollectionLayoutSection/supplementaryContentInsetsReference)

The reference boundary for content insets on boundary supplementary items.

[`UIContentInsetsReference`](/documentation/UIKit/UIContentInsetsReference)

Constants that describe the reference point of the content insets.

### Configuring additional views

[`boundarySupplementaryItems`](/documentation/UIKit/NSCollectionLayoutSection/boundarySupplementaryItems)

An array of the supplementary items that are associated with the boundary edges of the section, such as headers and footers.

[`decorationItems`](/documentation/UIKit/NSCollectionLayoutSection/decorationItems)

An array of the decoration items that are anchored to the section, such as background decoration views.

### Rendering items

[`visibleItemsInvalidationHandler`](/documentation/UIKit/NSCollectionLayoutSection/visibleItemsInvalidationHandler)

A closure called before each layout cycle to allow modification of the items in the section immediately before they’re displayed.

### Deprecated

[`supplementariesFollowContentInsets`](/documentation/UIKit/NSCollectionLayoutSection/supplementariesFollowContentInsets)

A Boolean value that indicates whether the section’s supplementary items follow the specified content insets for the section.



---

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)