문제

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