<!--
{
  "availability" : [
    "macOS: 10.11.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "AppKit",
  "identifier" : "/documentation/AppKit/NSCollectionViewDelegateFlowLayout/collectionView(_:layout:minimumLineSpacingForSectionAt:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "AppKit"
    ],
    "preciseIdentifier" : "c:objc(pl)NSCollectionViewDelegateFlowLayout(im)collectionView:layout:minimumLineSpacingForSectionAtIndex:"
  },
  "title" : "collectionView(_:layout:minimumLineSpacingForSectionAt:)"
}
-->

# collectionView(_:layout:minimumLineSpacingForSectionAt:)

Asks the delegate for the spacing between successive rows or columns of a section.

```
@MainActor optional func collectionView(_ collectionView: NSCollectionView, layout collectionViewLayout: NSCollectionViewLayout, minimumLineSpacingForSectionAt section: Int) -> CGFloat
```

## Parameters

`collectionView`

The collection view object displaying the flow layout.

`collectionViewLayout`

The layout object requesting the information.

`section`

The index of the section whose line spacing is needed.

## Return Value

The minimum space (in points) to apply between successive lines in a section.

## Discussion

Implement this method when you want to provide custom line spacing for sections in the flow layout. Your implementation can return the same line spacing for all sections or it can return different line spacing for different sections. You can also adjust the line spacing of each section dynamically each time you update the layout. If you do not implement this method, the line spacing is obtained from the properties of the flow layout object.

For a vertically scrolling layout, this value represents the minimum spacing between successive rows. For a horizontally scrolling layout, this value represents the minimum spacing between successive columns. This spacing is not applied to the space between the header and the first line or between the last line and the footer. For more information about how line spacing is applied, see the description of the [`minimumLineSpacing`](/documentation/AppKit/NSCollectionViewFlowLayout/minimumLineSpacing) property.

## See Also

[`minimumLineSpacing`](/documentation/AppKit/NSCollectionViewFlowLayout/minimumLineSpacing)

The minimum spacing (in points) to use between rows or columns.



---

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)