Add support for `sectionIndexLabel(_:)` (officially only available on iOS 26+)
Describe the feature
I'd like to use https://developer.apple.com/documentation/swiftui/view/sectionindexlabel(_:) on iOS 14+, which:
Sets the label that is used in a section index to point to this section, typically only a single character long.
Looks like this, roughly:
Is your feature request related to a problem?
No
Proposed solution
Adding a new backport for the section index label.
Alternatives considered
N/A
Additional context
N/A
This could be tricky to implement because one of the limitations from SwiftUI is awareness of "sections". We have the modern custom container APIs now which might help, but those were introduced in iOS 18 I believe but also they are only relevant for a "custom" container.
I have backported the custom container APIs (not in this package it seems) previously and they work really well, but they do not provide sectioning support since I couldn't find an approach to achieve that.
That all said, I may be over-thinking it, I just read this Issue and wanted to give some "some" kind of response quickly. Perhaps using my inspect APIs to find the underlying UICollectionView would yield better context and allow for this, but I'm uncertain if you could apply the modifiers in a true 'backport' way.
If you find a solution that MATCHES the official API I'd be happy to take a look and provide support. If you can solve it with a solution that DOES NOT match the official API, I'd also consider it in my SwiftUIPlus package.
I don't have a lot of time to investigate this atm but would love any contributions so if you manage to come up with a plan, we can discuss further if that's ok?