Permalink
Browse files

Merge pull request #110 from G-P-S/8a0cea10290fc8b513d0aaa3194d275a80…

…7090b9

Call deselectItemAtIndexPath in touchesEnded if item was selected
  • Loading branch information...
soffes committed May 8, 2012
2 parents 756e797 + 8a0cea1 commit d9225d93d419d71861fc1b1d2e45d0184f56b995
Showing with 5 additions and 1 deletion.
  1. +5 −1 SSToolkit/SSCollectionViewItem.m
@@ -93,7 +93,11 @@ - (void)touchesEnded:(NSSet *)touches withEvent:(UIEvent *)event {
[self setHighlighted:YES animated:NO];
if (CGRectContainsPoint(self.bounds, [[touches anyObject] locationInView:self])) {
- [self.collectionView selectItemAtIndexPath:self.indexPath animated:YES scrollPosition:SSCollectionViewScrollPositionNone];
+ if (self.isSelected) {
+ [self.collectionView deselectItemAtIndexPath:self.indexPath animated:YES];
+ } else {
+ [self.collectionView selectItemAtIndexPath:self.indexPath animated:YES scrollPosition:SSCollectionViewScrollPositionNone];
+ }
}
}

0 comments on commit d9225d9

Please sign in to comment.