-
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 binding SC deselection crash and publish 3.1.1 #921
Conversation
@rnystrom updated the pull request - view changes |
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.
LGTM! 🎉
IGTestDiffingSectionController *section = [self.adapter sectionControllerForObject:self.dataSource.objects.firstObject]; | ||
section.selectionDelegate = delegate; | ||
|
||
[self.adapter collectionView:self.collectionView didDeselectItemAtIndexPath:[NSIndexPath indexPathForItem:1 inSection:0]]; |
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.
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:)]) { |
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.
Actual fix here
@rnystrom has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator. |
Generated by 🚫 Danger |
Changes in this pull request
respondsToSelector:
(boo optionals)Checklist
CHANGELOG.md
for any breaking changes, enhancements, or bug fixes.