mirror of
https://github.com/JohnEstropia/CoreStore.git
synced 2026-01-11 20:00:30 +01:00
Displaying nested sections #261
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 @eraydiler on GitHub (Feb 14, 2019).
Hello,
I need to display some data in nested sections like;
Section
-SubSection
--Item
--Item
Section
-SubSection
--Item
-SubSection
--Item
--Item
--Item
...
Also need to track any changes and reflect them in the UI with listmonitor.
I found this question with a coredata related solution;
https://stackoverflow.com/questions/37203272/nested-sections-in-uitableview-and-core-data
When I tried to apply it with CoreStore, I couldn't give multiple arguments to list monitor's sectionBy(...). which matches with groupBy in coredata as far as I can understand.
Is there a way to apply coredata solution mentioned in the link with CoreStore?
Or do I need something else to represent items in nested sections like the sketch above?
@JohnEstropia commented on GitHub (Feb 14, 2019):
You'll need to process the indexPaths for the second-level sections yourself.
NSFetchedResultsController, whichListMonitorruns on top of, was designed forUITableViews andUICollectionViews, which support only one level of sectioning.The stackoverflow thread you linked gave an answer that throws out
NSFetchedResultsControlleraltogether and simply queries the store for an array ofDictionarys. What it doesn't say is it would still return just the first-level sections and not the inner section. You will still need to process the second-level sections by hand.@eraydiler commented on GitHub (Feb 14, 2019):
Got it, thanks for the answer.