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

Why should UICollectionViewDataSource be in UIViewController instead of UITableViewCell ? #52

Open
havelio opened this issue Mar 19, 2021 · 2 comments

Comments

@havelio
Copy link

havelio commented Mar 19, 2021

Hi thanks for sharing,
Would you tell me what the problem if we put UICollectionViewDataSource in the UITableViewCell ?

@ashfurrow-peril
Copy link

Hey! It looks like this repo hasn't been updated for a while. That probably means the repo's not a high-priority for @ashfurrow. He'll answer this issue if he can, but just a head's up.

If you're using this project, you have the skills to improve it. If you've reported a bug, you are encouraged to open a pull request that fixes it. And of course, you're welcome to discuss with other developers in this repository's issues and pull requests. Have a great day!

Generated by 🚫 dangerJS

@havelio havelio changed the title why UICollectionViewDataSource have to in UIViewController not in UITableViewCell ? Why should UICollectionViewDataSource be in UIViewController instead of UITableViewCell ? Mar 19, 2021
@ashfurrow
Copy link
Owner

It's a good question, and it's a matter of opinion, really. I believe that UITableViewCells should only be concerned with display logic. To make them the data sources for the collection view would violate the single-responsibility principle. You could do it – there's nothing stopping you – but I would recommend against it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants