mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-12-22 14:20:20 +00:00
Never use setAnimationsEnabled: so we don't risk corrupting enabledness
This commit is contained in:
@@ -10,6 +10,7 @@
|
||||
|
||||
#include <CoreGraphics/CGBase.h>
|
||||
#import <Foundation/Foundation.h>
|
||||
#import <UIKit/UIKit.h>
|
||||
#import "ASBaseDefines.h"
|
||||
|
||||
ASDISPLAYNODE_EXTERN_C_BEGIN
|
||||
@@ -27,6 +28,23 @@ CGFloat ASRoundPixelValue(CGFloat f);
|
||||
|
||||
ASDISPLAYNODE_EXTERN_C_END
|
||||
|
||||
/**
|
||||
@summary Conditionally performs UIView geometry changes in the given block without animation.
|
||||
|
||||
Used primarily to circumvent UITableView forcing insertion animations when explicitly told not to via
|
||||
`UITableViewRowAnimationNone`. More info: https://github.com/facebook/AsyncDisplayKit/pull/445
|
||||
|
||||
@param withoutAnimation Set to `YES` to perform given block without animation
|
||||
@param block Perform UIView geometry changes within the passed block
|
||||
*/
|
||||
ASDISPLAYNODE_INLINE void ASPerformBlockWithoutAnimation(BOOL withoutAnimation, void (^block)()) {
|
||||
if (withoutAnimation) {
|
||||
[UIView performWithoutAnimation:block];
|
||||
} else {
|
||||
block();
|
||||
}
|
||||
}
|
||||
|
||||
@interface NSIndexPath (ASInverseComparison)
|
||||
- (NSComparisonResult)asdk_inverseCompare:(NSIndexPath *)otherIndexPath;
|
||||
@end
|
||||
|
||||
Reference in New Issue
Block a user