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

Fix binding SC deselection crash and publish 3.1.1 #921

Closed
wants to merge 2 commits into from

Conversation

rnystrom
Copy link
Contributor

Changes in this pull request

Checklist

  • All tests pass. Demo project builds and runs.
  • I added tests, an experiment, or detailed why my change isn't tested.
  • I added an entry to the CHANGELOG.md for any breaking changes, enhancements, or bug fixes.

@facebook-github-bot
Copy link
Contributor

@rnystrom updated the pull request - view changes

@rnystrom rnystrom added this to the 3.1.1 milestone Aug 31, 2017
Copy link
Contributor

@jessesquires jessesquires left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! 🎉

IGTestDiffingSectionController *section = [self.adapter sectionControllerForObject:self.dataSource.objects.firstObject];
section.selectionDelegate = delegate;

[self.adapter collectionView:self.collectionView didDeselectItemAtIndexPath:[NSIndexPath indexPathForItem:1 inSection:0]];
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

W/out fix, tests crash here

@@ -124,7 +124,10 @@ - (void)didSelectItemAtIndex:(NSInteger)index {
}

- (void)didDeselectItemAtIndex:(NSInteger)index {
[self.selectionDelegate sectionController:self didDeselectItemAtIndex:index viewModel:self.viewModels[index]];
id<IGListBindingSectionControllerSelectionDelegate> selectionDelegate = self.selectionDelegate;
if ([selectionDelegate respondsToSelector:@selector(sectionController:didDeselectItemAtIndex:viewModel:)]) {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actual fix here

@facebook-github-bot
Copy link
Contributor

@rnystrom has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator.

@iglistkit-bot
Copy link

iglistkit-bot commented Sep 1, 2017

1 Warning
⚠️ Docs are regenerated when creating new releases.

Generated by 🚫 Danger

@rnystrom rnystrom deleted the optional-crash branch September 11, 2017 19:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

crash at self.selectionDelegate didDeselectItemAtIndex:
4 participants