UICollectionViewDataSource's indexTitles(for:) not working

indexTitles(for:) method on UICollectionViewDataSource is never triggered. I added it to my collection view, along with the required collectionView(_:indexPathForIndexTitle:at:) but neither of them is called. I tried in my work project as well as in a brand new empty one. I found that there are other developers who tried to use it with no success:

https://stackoverflow.com/a/44633982/4574147

https://stackoverflow.com/questions/47772185/how-to-add-an-indextitles-in-a-collectionview-ios-10


What can I do to make it work?

Replies

Did you ever find a solution for this? I'm having the same issue.

i need also help ..

I think there's an error in the documentation and that method works only on tvOS - see my answer here https://stackoverflow.com/questions/47772185/how-to-add-an-indextitles-in-a-collectionview-ios-10/48930418#48930418

I think there's an error in the documentation and that method works only on tvOS - see my answer here https://stackoverflow.com/questions/47772185/how-to-add-an-indextitles-in-a-collectionview-ios-10/48930418#48930418