From 82f59a8760c323976d37a0722709754b544f2679 Mon Sep 17 00:00:00 2001 From: Jonathan Kim Date: Thu, 29 Sep 2022 11:56:11 -0700 Subject: [PATCH] Fix IGListSectionController shouldSelectItemAtIndex: Summary: While attempting to use `-[IGListSectionController shouldSelectItemAtIndex:`, I found that any implementations of those methods never actually get called. It turned out that although the methods were added to the section controller (e.g. https://fb.workplace.com/groups/iglistkit/posts/1641463486199290/) and collection view delegate (https://www.internalfb.com/code/fbsource/[766baa5c9ffca558c9a7c5d1fdecc61ce8601e1d]/fbobjc/VendorLib/IGListKit/src/Source/IGListKit/Internal/IGListAdapter%2BUICollectionView.m?lines=125), the selectors weren't actually getting intercepted by the proxy. Docs: https://instagram.github.io/IGListKit/Classes/IGListSectionController.html#/c:objc(cs)IGListSectionController(im)shouldSelectItemAtIndex: Reviewed By: candance Differential Revision: D39910477 fbshipit-source-id: a2b0c56d0e6954baad26e87c2502c7e1dd79e96e --- Source/IGListKit/Internal/IGListAdapterProxy.m | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Source/IGListKit/Internal/IGListAdapterProxy.m b/Source/IGListKit/Internal/IGListAdapterProxy.m index f7733b0a..9a14d357 100644 --- a/Source/IGListKit/Internal/IGListAdapterProxy.m +++ b/Source/IGListKit/Internal/IGListAdapterProxy.m @@ -29,7 +29,9 @@ static BOOL isInterceptedSelector(SEL sel) { // UICollectionViewDelegate sel == @selector(collectionView:willDisplayCell:forItemAtIndexPath:) || sel == @selector(collectionView:didEndDisplayingCell:forItemAtIndexPath:) || + sel == @selector(collectionView:shouldSelectItemAtIndexPath:) || sel == @selector(collectionView:didSelectItemAtIndexPath:) || + sel == @selector(collectionView:shouldDeselectItemAtIndexPath:) || sel == @selector(collectionView:didDeselectItemAtIndexPath:) || sel == @selector(collectionView:didHighlightItemAtIndexPath:) || sel == @selector(collectionView:didUnhighlightItemAtIndexPath:) ||