---
title: "indexOfSection(_:)"
framework: uikit
role: symbol
role_heading: Instance Method
path: "uikit/nsdiffabledatasourcesnapshot-swift.struct/indexofsection(_:)"
---

# indexOfSection(_:)

Returns the index of the section of the snapshot with the specified identifier.

## Declaration

```swift
func indexOfSection(_ identifier: SectionIdentifierType) -> Int?
```

## Parameters

- `identifier`: The identifier of the section of the snapshot.

## Return Value

Return Value The index of the section of the snapshot, or nil if the section with the specified identifier doesn’t exist in the snapshot. This index value is 0-based.

## See Also

### Identifying items and sections

- [itemIdentifiers](uikit/nsdiffabledatasourcesnapshot-swift.struct/itemidentifiers.md)
- [sectionIdentifiers](uikit/nsdiffabledatasourcesnapshot-swift.struct/sectionidentifiers.md)
- [indexOfItem(_:)](uikit/nsdiffabledatasourcesnapshot-swift.struct/indexofitem(_:).md)
- [itemIdentifiers(inSection:)](uikit/nsdiffabledatasourcesnapshot-swift.struct/itemidentifiers(insection:).md)
- [sectionIdentifier(containingItem:)](uikit/nsdiffabledatasourcesnapshot-swift.struct/sectionidentifier(containingitem:).md)
