Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve collection supplementary view support #55

Open
jessesquires opened this issue Jan 24, 2018 · 2 comments
Open

Improve collection supplementary view support #55

jessesquires opened this issue Jan 24, 2018 · 2 comments

Comments

@jessesquires
Copy link
Contributor

CollectionViewModel.SectionModel is unnecessarily limited to:

let cellViewModels: [CollectionViewCellViewModel]?
let headerViewModel: CollectionViewSupplementaryViewModel?
let footerViewModel: CollectionViewSupplementaryViewModel?

CollectionViews can have arbitrary supplementary views — they are not limited to headers and footers.

(Note: FlowLayout is limited to only headers / footers)

We should update the model to reflect this.

@asmallteapot
Copy link

(Note: These are called CollectionSectionViewModel on master.)

There are two possible approaches for resolving this: we can keep CollectionSectionViewModel as a struct and try to make its API generic for any kind of supplementary view/collection view layout, or we can extract a CollectionSectionViewModel protocol and rename the current implementation to CollectionFlowLayoutSectionViewModel or something. Thoughts?

@jessesquires
Copy link
Contributor Author

hey @asmallteapot! 👋 sorry for the delay 😳

I think my original comment was confusing. The problematic part is:

let headerViewModel: CollectionViewSupplementaryViewModel?
let footerViewModel: CollectionViewSupplementaryViewModel?

This should really just be:

let supplementaryViewModels: [CollectionViewSupplementaryViewModel]

To reflect that collection view has arbitrary supplementary views.

@benasher44 benasher44 modified the milestones: 0.2.0, 0.3.0 Sep 11, 2018
@benasher44 benasher44 modified the milestones: 0.3.0, 0.4.0 Sep 20, 2018
@jessesquires jessesquires modified the milestones: 0.4.0, Next Jan 7, 2019
@jessesquires jessesquires removed their assignment Oct 24, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants