From 2b282a8971827bc4daa2c27f8ea0ee7f0315e0a6 Mon Sep 17 00:00:00 2001 From: Jordan Helzer Date: Fri, 15 Aug 2014 07:55:22 -0600 Subject: [PATCH] Changed call in relayoutViews to create the viewRect to pass the created rect through CGRectIntegral because the rect created and passed into the indexToRectMap sometimes would not match the actual rect created for the view when the NSStringFromCGRect call was subsequently made in the - (BOOL)gestureRecognizer:(UIGestureRecognizer *)gestureRecognizer shouldReceiveTouch:(UITouch *)touch and - (void)didSelectView:(UITapGestureRecognizer *)gestureRecognizer due to rounding that sometimes occurred. This ultimately ended up in the - (void)collectionView:(PSCollectionView *)collectionView didSelectCell:(PSCollectionViewCell *)cell atIndex:(NSInteger)index not being called when a cell actually had been tapped. --- PSCollectionView.m | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/PSCollectionView.m b/PSCollectionView.m index 2e5d405..a674336 100644 --- a/PSCollectionView.m +++ b/PSCollectionView.m @@ -262,7 +262,7 @@ - (void)relayoutViews { CGFloat top = [[colOffsets objectAtIndex:col] floatValue]; CGFloat colHeight = [self.collectionViewDataSource collectionView:self heightForRowAtIndex:i]; - CGRect viewRect = CGRectMake(left, top, self.colWidth, colHeight); + CGRect viewRect = CGRectIntegral(CGRectMake(left, top, self.colWidth, colHeight)); // Add to index rect map [self.indexToRectMap setObject:NSStringFromCGRect(viewRect) forKey:key];