Created
January 19, 2013 10:53
-
-
Save mipstian/4571986 to your computer and use it in GitHub Desktop.
UICollectionView category to disable animation on reloadItemsAtIndexPaths:
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#import <UIKit/UIKit.h> | |
@interface UICollectionView (ReloadItemsAnimated) | |
- (void)reloadItemsAtIndexPaths:(NSArray *)indexPaths animated:(BOOL)animated; | |
@end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#import "UICollectionView+ReloadItemsAnimated.h" | |
#import <QuartzCore/QuartzCore.h> | |
@implementation UICollectionView (ReloadItemsAnimated) | |
- (void)reloadItemsAtIndexPaths:(NSArray *)indexPaths animated:(BOOL)animated { | |
if (!animated) { | |
[CATransaction begin]; | |
[CATransaction setValue:(id)kCFBooleanTrue forKey:kCATransactionDisableActions]; | |
} | |
[self reloadItemsAtIndexPaths:indexPaths]; | |
if (!animated) { | |
[CATransaction commit]; | |
} | |
} | |
@end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Thank you!