How to put alphabetical index on right side of a UITableview

20,464

Solution 1

There is a delegate method for UITableview to do this job.

override func sectionIndexTitlesForTableView(tableView: UITableView) -> [AnyObject]! { return indexTitlesArray }

This is the method that shows indexTitlesForTableView. return indexTitles from this method.

Here is the link for more info: Section index titles for tableView

Solution 2

You need to implement the delegate method sectionIndexTitlesForTableView. This method is used to add quick jump navigation feature with UITableView.

You can refer this article.

https://www.appcoda.com/ios-programming-index-list-uitableview/

Share:
20,464
Delete My Account
Author by

Delete My Account

Updated on July 09, 2022

Comments

  • Delete My Account
    Delete My Account almost 2 years

    I'm using Xcode 8 and Swift 3. I would like to create a dynamic UITableView to hold customer names with an alphabetical index letters or tabs on the right side for quick navigation.

    I have found info on how to create the dynamic UITableView, so I'm good there, but haven't found any info on how to the alphabetical indexing.

    Could someone please provide some information on how to do the indexing on a UITableView?