mirror of
https://github.com/JohnEstropia/CoreStore.git
synced 2026-01-11 20:00:30 +01:00
ListPublisher section name transformer not working #355
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @joeljfischer on GitHub (Jan 1, 2021).
Hi, I have a
.sectionByclause set up, but it appears that the name transformer isn't working.Here,
$.isStarteda boolean virtual property, but that all appears to be working correctly. I can breakpoint within the.sectionByclosure and it's running and returning the correct string, but0or1is still appearing as the section header of my list. Do I need to implementtitleForHeader/viewForHeaderInSection? It says to do so under theListMonitordocumentation but not the list publisher documentation. If so, what would I access to see my transformed string?@JohnEstropia commented on GitHub (Jan 3, 2021):
@joeljfischer The titleForHeader / viewForHeaderInSection for DiffableDataSource adapters currently doesn't support the custom sectionIndex transformers, sorry about that. I'll try to rework the adapters in an update, but for now you have the following options to work around it:
DiffableDataSource.TableViewAdapterorDiffableDataSource.CollectionViewAdapterand override thetableView(_:titleForHeaderInSection:)orcollectionView(_:viewForSupplementaryElementOfKind:at:)Field.Virtualproperty that implements the logic. You can then use that property as thesectionBykey. See the Demo app's example: