Don't update the delegate unless the selection actually changes

This commit is contained in:
Gregory John Casamento 2022-10-01 03:16:38 -04:00
parent a6f83ab00b
commit e9e1615cdb

View file

@ -440,17 +440,22 @@ static NSString *placeholderItem = nil;
return;
}
if ([_selectionIndexPaths isEqual: indexPaths])
{
return;
}
else
{
ASSIGN(_selectionIndexPaths, indexPaths);
}
if ([_delegate respondsToSelector: @selector(collectionView:shouldSelectItemsAtIndexPaths:)])
{
indexPaths = [_delegate collectionView: self
shouldSelectItemsAtIndexPaths: indexPaths];
}
if (![_selectionIndexPaths isEqual: indexPaths])
{
ASSIGN(_selectionIndexPaths, indexPaths);
}
// First unselect all of the items
FOR_IN(id, item, _visibleItems)
{