<!--
{
  "availability" : [
    "iOS: 2.0.0 -",
    "iPadOS: 2.0.0 -",
    "macCatalyst: 13.1.0 -",
    "tvOS: -",
    "visionOS: 1.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "UIKit",
  "identifier" : "/documentation/UIKit/UITableViewDataSource/tableView(_:sectionForSectionIndexTitle:at:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "UIKit"
    ],
    "preciseIdentifier" : "c:objc(pl)UITableViewDataSource(im)tableView:sectionForSectionIndexTitle:atIndex:"
  },
  "title" : "tableView(_:sectionForSectionIndexTitle:at:)"
}
-->

# tableView(_:sectionForSectionIndexTitle:at:)

Asks the data source to return the index of the section having the given title and section title index.

```
optional func tableView(_ tableView: UITableView, sectionForSectionIndexTitle title: String, at index: Int) -> Int
```

## Parameters

`tableView`

The table-view object requesting this information.

`title`

The title as displayed in the section index of `tableView`.

`index`

An index number identifying a section title in the array returned by [`sectionIndexTitles(for:)`](/documentation/UIKit/UITableViewDataSource/sectionIndexTitles(for:)).

## Return Value

An index number identifying a section.

## Discussion

This method is passed the index number and title of an entry in the section index list and should return the index of the referenced section. To be clear, there are two index numbers in play here: an index to a section index title in the array returned by [`sectionIndexTitles(for:)`](/documentation/UIKit/UITableViewDataSource/sectionIndexTitles(for:)), and an index to a section of the table view; the former is passed in, and the latter is returned. You implement this method only for table views with a section index list — which can only be table views created in the plain style ([`UITableView.Style.plain`](/documentation/UIKit/UITableView/Style-swift.enum/plain)). Note that the array of section titles returned by [`sectionIndexTitles(for:)`](/documentation/UIKit/UITableViewDataSource/sectionIndexTitles(for:)) can have fewer items than the actual number of sections in the table view.

## See Also

[`-  numberOfSectionsInTableView:`](/documentation/UIKit/UITableViewDataSource/numberOfSections(in:))

Asks the data source to return the number of sections in the table view.



---

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)