Skip to content

Commit

Permalink
Merge pull request #95 from chiahsien/revert-93-master
Browse files Browse the repository at this point in the history
Revert "Remove cached layout attribute objects when collection view has ...
  • Loading branch information
chiahsien committed Apr 12, 2015
2 parents 51ffce7 + 8854fbd commit 8d29387
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions CHTCollectionViewWaterfallLayout.m
Original file line number Diff line number Diff line change
Expand Up @@ -193,13 +193,6 @@ - (id)initWithCoder:(NSCoder *)aDecoder {
#pragma mark - Methods to Override
- (void)prepareLayout {
[super prepareLayout];

[self.headersAttribute removeAllObjects];
[self.footersAttribute removeAllObjects];
[self.unionRects removeAllObjects];
[self.columnHeights removeAllObjects];
[self.allItemAttributes removeAllObjects];
[self.sectionItemAttributes removeAllObjects];

NSInteger numberOfSections = [self.collectionView numberOfSections];
if (numberOfSections == 0) {
Expand All @@ -212,6 +205,13 @@ - (void)prepareLayout {
// Initialize variables
NSInteger idx = 0;

[self.headersAttribute removeAllObjects];
[self.footersAttribute removeAllObjects];
[self.unionRects removeAllObjects];
[self.columnHeights removeAllObjects];
[self.allItemAttributes removeAllObjects];
[self.sectionItemAttributes removeAllObjects];

for (NSInteger section = 0; section < numberOfSections; section++) {
NSInteger columnCount = [self columnCountForSection:section];
NSMutableArray *sectionColumnHeights = [NSMutableArray arrayWithCapacity:columnCount];
Expand Down

0 comments on commit 8d29387

Please sign in to comment.