---
title: "index(ofSectionTitled:)"
framework: SwiftData
role: symbol
role_heading: Instance Method
platforms: [iOS 27.0+, iPadOS 27.0+, Mac Catalyst 27.0+, macOS 27.0+, tvOS 27.0+, visionOS 27.0+, watchOS 27.0+]
path: "swiftdata/sectionedresults/index(ofsectiontitled:)"
---

# index(ofSectionTitled:)

Returns the ordered index of the section with the given title, or nil if not found.

## Declaration

```swift
func index(ofSectionTitled title: SectionTitle) -> Int?
```

## Discussion

Discussion note: O(1)
