apploft / APLExpandableCollectionView

UICollectionView subclass with vertically expandable and collapsible sections
MIT License
110 stars 14 forks source link

DataSource responsibilities #17

Closed irrelevantat closed 8 years ago

irrelevantat commented 8 years ago

I have been browsing through the code base, and have a question: I don't really understand why you need the following methods to manipulate the data source:

- (void)addExpandedSection:(BOOL)isExpanded;
- (void)insertExpandedSection:(BOOL)isExpanded atIndex:(NSUInteger)index;

In the end, I could just change my original dataSource and then call reloadData to have the same effect, or am I missing something (ignoring that it seems to be the only way to expand #16 atm)? Generally, I don't understand why the collection takes over data source responsibilities. In my eyes it just encourages inconsistencies between the "two" different data sources.

And I wanted to thank you for your work! I wanted to build exactly the same view, but then discovered your solution.