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.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top