I would like to know how I can filter my list and create an alphabetical section index to the side of a List
in SwiftUI, as is possible with the sectionIndexTitlesForTableView
UITableViewDataSource
delegate method in UIKit
.
Here is an example of what I would like to do
How can I do this?
Here is the list I have so far: List built so far
If you're looking for a similar delegate method in SwiftUI you won't find one. Not yet at least.
I would suggest building a separate VStack of the section indexes (array you built already as you normally would for the delegate). Then just wrap your section indexes and your List in a ZStack.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With