Instance Method


Returns the section that the table view should scroll to for the given index title.


func section(forSectionIndexTitle indexTitleIndex: Int) -> Int



An integer identifying a section-index title by its position in the array of such titles.

Return Value

An integer identifying the table-view section associated with indexTitleIndex.


This method allows the table view to map between a given item in the section index and a given section even when there isn't a one-to-one mapping. In its implementation of tableView(_:sectionForSectionIndexTitle:at:), the data source can call this method on the indexed-collation object specifying as an argument the passed-in index integer; it then returns the result to the table view.

See Also

Providing Section Index Data to the Table View

var sectionTitles: [String]

Returns the list of section titles for the table view.

var sectionIndexTitles: [String]

Returns the list of section-index titles for the table view