-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
Fix for #378 - emptyView not updated when items added #395
Conversation
@@ -2,6 +2,12 @@ | |||
|
|||
The changelog for `IGListKit`. Also see the [releases](https://github.com/instagram/IGListKit/releases) on GitHub. | |||
|
|||
### Enhancements |
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.
Just for the sake of completion we should add a header for 2.2.0 with a link to the milestone
Also can you add a link to this pull request at the end of your contribution, following the same format as other changelog entries
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.
Sure thing, CHANGELOG.md
updated.
@edmonston updated the pull request - view changes |
@edmonston updated the pull request - view changes |
|
||
- (BOOL)itemCountIsZero { | ||
__block BOOL isZero = YES; | ||
[self.sectionMap enumerateUsingBlock:^(id _Nonnull object, IGListSectionController<IGListSectionType> * _Nonnull sectionController, NSInteger section, BOOL * _Nonnull stop) { |
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.
minor nit: could we specify an explicit type for id __Nonnull object
?
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.
hmm, can we? it seems like id
is the best we can do based on the signature of [IGListSectionMap enumerateUsingBlock:]
, but quite possibly I am missing something...
- (void)enumerateUsingBlock:(void (^)(id object, IGListSectionController<IGListSectionType> *sectionController, NSInteger section, BOOL *stop))block;
https://github.com/Instagram/IGListKit/blob/master/Source/Internal/IGListSectionMap.h#L103
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.
oops! 😳 nevermind. 😄
Looks good to me. Thanks @edmonston ! 💯 |
@jessesquires has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator. |
Changes in this pull request
Modified
IGListAdapter
to update thehidden
status of theemptyView
after any item-level changes (insertInSectionController:atIndexes:
and related methods) based on whether the item count is zero.Closes #378
Pull request checklist
CHANGELOG.md
for any breaking changes, enhancements, or bug fixes.