---
title: "index(for:)"
framework: uikit
role: symbol
role_heading: Instance Method
path: "uikit/uicollectionviewdiffabledatasource-9tqpa/index(for:)"
---

# index(for:)

Returns an index for the section with the identifier you specify in the collection view.

## Declaration

```swift
@MainActor @preconcurrency func index(for sectionIdentifier: SectionIdentifierType) -> Int?
```

## See Also

### Identifying sections

- [sectionIdentifier(for:)](uikit/uicollectionviewdiffabledatasource-9tqpa/sectionidentifier(for:).md)
