-
Notifications
You must be signed in to change notification settings - Fork 15
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
Auto cell registration + unify table and collection views #98
Conversation
Sources/CellParentViewProtocol.swift
Outdated
For `UICollectionViewCell`, this would be `UICollectionView`. | ||
For `UITableViewCell`, this would be `UITableView`. | ||
*/ | ||
protocol CellParentViewProtocol { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How do you feel about Container
versus Parent
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🤷♂️
either works for me
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also like container :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
will update!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is great!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Beautiful 👏👏👏
Sources/CellParentViewProtocol.swift
Outdated
For `UICollectionViewCell`, this would be `UICollectionView`. | ||
For `UITableViewCell`, this would be `UITableView`. | ||
*/ | ||
protocol CellParentViewProtocol { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also like container :)
public protocol ReusableSupplementaryViewProtocol { | ||
|
||
/// The registration info for the supplementary view. | ||
var viewInfo: SupplementaryViewInfo? { get } // TODO: make this not optional |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are you avoiding addressing this TODO now to keep this PR reasonably sized?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
correct. will follow-up
Rather than copy-pasta table view code for collection view, let's unify them. This introduces `CellParentViewProtocol` to reduce duplication in auto-registering cells. It unifies the APIs of tables and collections. On top of this, we add `ReusableCellProtocol` and `ReusableSupplementaryViewProtocol` to unify our cell view models and supplementary view models. Now there's a single API for registering cells automatically. All work based on: https://github.com/jessesquires/JSQDataSourcesKit/blob/develop/Source/ReusableViewConfig.swift Almost completes #18, starts initial work on #46
2465185
to
f6a0e5c
Compare
Rather than copy-pasta table view code for collection view, let's unify them.
This introduces
CellParentViewProtocol
to reduce duplication in auto-registering cells. It unifies the APIs of tables and collections.On top of this, we add
ReusableCellProtocol
andReusableSupplementaryViewProtocol
to unify our cell view models and supplementary view models.Now there's a single API for registering cells automatically.
All work based on:
https://github.com/jessesquires/JSQDataSourcesKit/blob/develop/Source/ReusableViewConfig.swift
Almost completes #18, starts initial work on #46