---
title: "controller(_:sectionIndexTitleForSectionName:)"
framework: coredata
role: symbol
role_heading: Instance Method
path: "coredata/nsfetchedresultscontrollerdelegate/controller(_:sectionindextitleforsectionname:)"
---

# controller(_:sectionIndexTitleForSectionName:)

Returns the name for a given section.

## Declaration

```swift
optional func controller(_ controller: NSFetchedResultsController<any NSFetchRequestResult>, sectionIndexTitleForSectionName sectionName: String) -> String?
```

## Parameters

- `controller`: The fetched results controller that sent the message.
- `sectionName`: The default name of the section.

## Return Value

Return Value The string to use as the name for the specified section.

## Discussion

Discussion This method does not enable change tracking. It is only needed if a section index is used. If the delegate doesn’t implement this method, the default implementation returns the capitalized first letter of the section name (see sectionIndexTitle(forSectionName:) in NSFetchedResultsController).
