Forked from mipstian/UICollectionView+ReloadItemsAnimated.h
Last active
September 20, 2015 16:47
-
-
Save nuno/fa990342319808adbf8a to your computer and use it in GitHub Desktop.
UICollectionView category to disable animation on reloadItemsAtIndexPaths:
This file contains hidden or 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 hidden or 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