This repository was archived by the owner on Apr 15, 2020. It is now read-only.
Made generic Item parameter a typealias in data source providers#25
Merged
jessesquires merged 2 commits intoOct 22, 2015
Merged
Conversation
Owner
|
@MrAlek -- Thanks! This is awesome. Excellent point. Great catch. 😄 ❤️ Wish this could have been included in 2.0 (just released) 😆 I'll merge soon. |
Contributor
Author
|
Glad I could help and thanks for making the library :) |
Owner
There was a problem hiding this comment.
Minor tweak: let's treat SectionInfo as "the source of truth". I view the Section as the data, not the CellFactory.
where SectionInfo.Item == CellFactory.Item, SectionInfo.Item == SupplementaryViewFactory.ItemSame change for the typealias, and add doc comments. 😄
/// The type of elements for the data source provider.
public typealias Item = SectionInfo.Item
Owner
|
Hey @MrAlek -- thought about this a bit more. Just a couple small comments to address! |
Contributor
Author
|
@jessesquires I'll fix! |
Contributor
Author
|
@jessesquires I also reversed the where clause expressions to avoid yoda-conditioning since the |
jessesquires
added a commit
that referenced
this pull request
Oct 22, 2015
Remove generic Item parameter in data source providers. It's superfluous.
Owner
|
Thanks @MrAlek ! 👍 |
4 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Since the
Itemgeneric parameter in the data source providers is inferred by theItemtypes in cell, section & reusable view factories, it felt unnecessary to have to provide it when creating a data source provider.This PR removed the generic parameter and adds it as a public typealias instead, to reduce verbosity while still keeping the type hierarchy clean.