Revert "Temporarily make logging around conversation view row updates more verbose."

This reverts commit 105b033761.
pull/1/head
Matthew Chen 8 years ago
parent ab7522c47f
commit 42a70e0def

@ -2884,8 +2884,7 @@ typedef NS_ENUM(NSInteger, MessagesRangeSizeMode) {
for (YapDatabaseViewRowChange *rowChange in rowChanges) { for (YapDatabaseViewRowChange *rowChange in rowChanges) {
switch (rowChange.type) { switch (rowChange.type) {
case YapDatabaseViewChangeDelete: { case YapDatabaseViewChangeDelete: {
DDLogInfo(@"YapDatabaseViewChangeDelete: %@, %@", rowChange.collectionKey, rowChange.indexPath); DDLogVerbose(@"YapDatabaseViewChangeDelete: %@, %@", rowChange.collectionKey, rowChange.indexPath);
[DDLog flushLog];
[self.collectionView deleteItemsAtIndexPaths:@[ rowChange.indexPath ]]; [self.collectionView deleteItemsAtIndexPaths:@[ rowChange.indexPath ]];
[rowsThatChangedSize removeObject:@(rowChange.indexPath.row)]; [rowsThatChangedSize removeObject:@(rowChange.indexPath.row)];
YapCollectionKey *collectionKey = rowChange.collectionKey; YapCollectionKey *collectionKey = rowChange.collectionKey;
@ -2893,8 +2892,8 @@ typedef NS_ENUM(NSInteger, MessagesRangeSizeMode) {
break; break;
} }
case YapDatabaseViewChangeInsert: { case YapDatabaseViewChangeInsert: {
DDLogInfo(@"YapDatabaseViewChangeInsert: %@, %@", rowChange.collectionKey, rowChange.newIndexPath); DDLogVerbose(
[DDLog flushLog]; @"YapDatabaseViewChangeInsert: %@, %@", rowChange.collectionKey, rowChange.newIndexPath);
[self.collectionView insertItemsAtIndexPaths:@[ rowChange.newIndexPath ]]; [self.collectionView insertItemsAtIndexPaths:@[ rowChange.newIndexPath ]];
[rowsThatChangedSize removeObject:@(rowChange.newIndexPath.row)]; [rowsThatChangedSize removeObject:@(rowChange.newIndexPath.row)];
@ -2909,18 +2908,16 @@ typedef NS_ENUM(NSInteger, MessagesRangeSizeMode) {
break; break;
} }
case YapDatabaseViewChangeMove: { case YapDatabaseViewChangeMove: {
DDLogInfo(@"YapDatabaseViewChangeMove: %@, %@, %@", DDLogVerbose(@"YapDatabaseViewChangeMove: %@, %@, %@",
rowChange.collectionKey, rowChange.collectionKey,
rowChange.indexPath, rowChange.indexPath,
rowChange.newIndexPath); rowChange.newIndexPath);
[DDLog flushLog];
[self.collectionView deleteItemsAtIndexPaths:@[ rowChange.indexPath ]]; [self.collectionView deleteItemsAtIndexPaths:@[ rowChange.indexPath ]];
[self.collectionView insertItemsAtIndexPaths:@[ rowChange.newIndexPath ]]; [self.collectionView insertItemsAtIndexPaths:@[ rowChange.newIndexPath ]];
break; break;
} }
case YapDatabaseViewChangeUpdate: { case YapDatabaseViewChangeUpdate: {
DDLogInfo(@"YapDatabaseViewChangeUpdate: %@, %@", rowChange.collectionKey, rowChange.indexPath); DDLogVerbose(@"YapDatabaseViewChangeUpdate: %@, %@", rowChange.collectionKey, rowChange.indexPath);
[DDLog flushLog];
[self.collectionView reloadItemsAtIndexPaths:@[ rowChange.indexPath ]]; [self.collectionView reloadItemsAtIndexPaths:@[ rowChange.indexPath ]];
[rowsThatChangedSize removeObject:@(rowChange.indexPath.row)]; [rowsThatChangedSize removeObject:@(rowChange.indexPath.row)];
break; break;
@ -2932,10 +2929,8 @@ typedef NS_ENUM(NSInteger, MessagesRangeSizeMode) {
// as they may affect which cells show "date" headers or "status" footers. // as they may affect which cells show "date" headers or "status" footers.
NSMutableArray<NSIndexPath *> *rowsToReload = [NSMutableArray new]; NSMutableArray<NSIndexPath *> *rowsToReload = [NSMutableArray new];
for (NSNumber *row in rowsThatChangedSize) { for (NSNumber *row in rowsThatChangedSize) {
DDLogInfo(@"YapDatabaseViewChange reload other row: %@", row);
[rowsToReload addObject:[NSIndexPath indexPathForRow:row.integerValue inSection:0]]; [rowsToReload addObject:[NSIndexPath indexPathForRow:row.integerValue inSection:0]];
} }
[DDLog flushLog];
[self.collectionView reloadItemsAtIndexPaths:rowsToReload]; [self.collectionView reloadItemsAtIndexPaths:rowsToReload];
}; };
void (^batchUpdatesCompletion)(BOOL) = ^(BOOL finished) { void (^batchUpdatesCompletion)(BOOL) = ^(BOOL finished) {
@ -2952,18 +2947,14 @@ typedef NS_ENUM(NSInteger, MessagesRangeSizeMode) {
} }
}; };
DDLogInfo(@"Before performBatchUpdates: %d", shouldAnimateUpdates);
[DDLog flushLog];
if (shouldAnimateUpdates) { if (shouldAnimateUpdates) {
[self.collectionView performBatchUpdates:batchUpdates completion:batchUpdatesCompletion]; [self.collectionView performBatchUpdates:batchUpdates completion:batchUpdatesCompletion];
} else { } else {
[CATransaction begin]; [CATransaction begin];
[CATransaction setAnimationDuration:0.1f]; [CATransaction setAnimationDuration:0.05f];
[self.collectionView performBatchUpdates:batchUpdates completion:batchUpdatesCompletion]; [self.collectionView performBatchUpdates:batchUpdates completion:batchUpdatesCompletion];
[CATransaction commit]; [CATransaction commit];
} }
DDLogInfo(@"After performBatchUpdates");
[DDLog flushLog];
} }
- (BOOL)shouldAnimateRowUpdates:(NSArray<YapDatabaseViewRowChange *> *)rowChanges - (BOOL)shouldAnimateRowUpdates:(NSArray<YapDatabaseViewRowChange *> *)rowChanges

Loading…
Cancel
Save