-
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
Add Collection conformance for *SectionModel types #135
Conversation
370bd84
to
ed3f40c
Compare
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.
Very nice 😎
25a55de
Sources/CollectionViewModel.swift
Outdated
return self.cellViewModels.startIndex | ||
} | ||
|
||
public var endIndex: Int { |
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.
actually, each of these declarations should have /// :nodoc:
to exempt them from generating empty docs
Sources/CollectionViewModel.swift
Outdated
@@ -167,3 +167,22 @@ public struct CollectionSectionViewModel: DiffableViewModel { | |||
self.diffingKey = diffingKey | |||
} | |||
} | |||
|
|||
/// Collection support for diffing | |||
extension CollectionSectionViewModel: Collection { |
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.
nit: maybe say "CollectionSectionViewModel
conforms to Collection
"
or leave as /// :nodoc:
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.
Why is CollectionSectionViewModel conforms to Collection
more informative than CollectionSectionViewModel: Collection
+ the current comment?
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.
Sorry just feel like that comment is a bit redundant. Just in case, I add backticks around Collection
, which might make it read a bit better.
d01b430
to
535d58c
Compare
e69beed
to
404dbc3
Compare
Changes in this pull request
This adds
Collection
conformance to *SectionModel
types, which eases upgrading to Swift-based, non-Dwifft diffing (most diffCollection
s).Checklist
CHANGELOG.md
for any breaking changes, enhancements, or bug fixes.