jessesquires / jessesquires/ReactiveCollectionsKit

[DataSource] implement section index titles

Open
#3 0 comments 0 reactions 0 assignees View on GitHub
feature request
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

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.