Expanding Core Data UITableView Section with only 1 row
-
13-06-2021 - |
Вопрос
I have an app that uses Core Data and NSFetchedResultsController
to create a UITableView
with 3 sections, all based off a core data NSString
attribute called itemRange
. I have no problems creating or putting the items in sections, but I would like to add a particular feature that I'm not sure how to implement.
I want to be able to at first only show 1 or 2 items per section, but then have 1 more cell that says "see all" which expands the section to show all of the items.
Any ideas on how this could be implemented? Any help would be greatly appreciated.
Нет правильного решения
Другие советы
Just modify your numberOfRowsInSection
to display the desired number of rows. Use your own variable (or array thereof) to keep track of the expanded state of each section.
Then modify cellForRowAtIndexPath
to either show the content delivered by the fetched results controller, or show the "see all" cell.