jessesquires / jessesquires/ReactiveCollectionsKit
[DataSource] implement section index titles
- Dominant language
- Swift
- Stars
- 194
- Forks
- 12
- PR merge metrics
- No merged PRs in 30d
Description
Docs: https://developer.apple.com/documentation/uikit/uicollectionviewdatasource#2851612
```swift
optional func indexTitles(for collectionView: UICollectionView) -> [String]?
optional func collectionView(_ collectionView: UICollectionView, indexPathForIndexTitle title: String, at index: Int) -> IndexPath
```
This will need to be implemented at the `CollectionViewModel` level.
Maybe we wrap this functionality in a new protocol, pass that in, then call these methods via the data source implementation.
Rough example:
```swift
protocol IndexTitleViewModel {
var indexTitles: [String]? { get }
func indexPathForIndexTitle(_ title: String, at index: Int) -> IndexPath
}
```
Contributor guide
Assessment
This issue has not been assessed yet.