A performant Grid-View for iOS (iPhone/iPad) that allows sorting of views with gestures (the user can move the items with his finger to sort them) and pinching/rotating/panning gestures allow the user to play with the view and toggle from the cellview to a fullsize display.
MIT License
2.3k
stars
512
forks
source link
After rotating to landscape and then use scrollToObjectAtIndex, then use reloadData with new data source some wrong cells are shown #178
// Have to remove subviews because of bug
for (UIView * v in [self subviews])
{
if ([v isKindOfClass:[GMGridViewCell class]])
{
[v removeFromSuperview];
}
}
I found that the issue in subviews that is still added to rid view, to solve problem have to add code to remove GMGridViews from subviews
(void)reloadData { CGPoint previousContentOffset = self.contentOffset;
[[self itemSubviews] enumerateObjectsUsingBlock:^(id obj, NSUInteger index, BOOL stop) { if ([obj isKindOfClass:[GMGridViewCell class]]) { [(UIView )obj removeFromSuperview]; [self queueReusableCell:(GMGridViewCell *)obj]; } }];
// Have to remove subviews because of bug for (UIView * v in [self subviews]) { if ([v isKindOfClass:[GMGridViewCell class]]) { [v removeFromSuperview]; } }
...