<!--
{
  "availability" : [
    "macOS: 10.15.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "AppKit",
  "identifier" : "/documentation/AppKit/NSDiffableDataSourceSnapshotReference/sectionIdentifier(forSectionContainingItemIdentifier:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "AppKit"
    ],
    "preciseIdentifier" : "c:objc(cs)NSDiffableDataSourceSnapshot(im)sectionIdentifierForSectionContainingItemIdentifier:"
  },
  "title" : "sectionIdentifier(forSectionContainingItemIdentifier:)"
}
-->

# sectionIdentifier(forSectionContainingItemIdentifier:)

Returns the identifier of the section containing the specified item in the snapshot.

```
func sectionIdentifier(forSectionContainingItemIdentifier itemIdentifier: Any) -> Any?
```

## Parameters

`itemIdentifier`

The identifier of the item contained in the section of the snapshot.

## Return Value

The identifier of the section containing the specified item, or `nil` if the specified item doesn’t exist in any section of the snapshot.

---

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)