mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-08-17 19:09:56 +00:00
use asyncDisplayNodePerformOnMainThread
This commit is contained in:
parent
77113c6698
commit
fee3892f95
@ -12,6 +12,7 @@
|
|||||||
#import "ASFlowLayoutController.h"
|
#import "ASFlowLayoutController.h"
|
||||||
#import "ASRangeController.h"
|
#import "ASRangeController.h"
|
||||||
#import "ASDataController.h"
|
#import "ASDataController.h"
|
||||||
|
#import "ASDisplayNodeInternal.h"
|
||||||
|
|
||||||
|
|
||||||
#pragma mark -
|
#pragma mark -
|
||||||
@ -135,14 +136,10 @@ static BOOL _isInterceptedSelector(SEL sel)
|
|||||||
{
|
{
|
||||||
[_dataController reloadData];
|
[_dataController reloadData];
|
||||||
|
|
||||||
if ([NSThread isMainThread]) {
|
ASDisplayNodePerformBlockOnMainThread(^{
|
||||||
[super reloadData];
|
|
||||||
} else {
|
|
||||||
dispatch_async(dispatch_get_main_queue(), ^{
|
|
||||||
[super reloadData];
|
[super reloadData];
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
- (void)setDataSource:(id<UICollectionViewDataSource>)dataSource
|
- (void)setDataSource:(id<UICollectionViewDataSource>)dataSource
|
||||||
{
|
{
|
@ -13,6 +13,8 @@
|
|||||||
#import "ASFlowLayoutController.h"
|
#import "ASFlowLayoutController.h"
|
||||||
#import "ASLayoutController.h"
|
#import "ASLayoutController.h"
|
||||||
#import "ASRangeController.h"
|
#import "ASRangeController.h"
|
||||||
|
#import "ASDisplayNodeInternal.h"
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#pragma mark -
|
#pragma mark -
|
||||||
@ -185,15 +187,10 @@ static BOOL _isInterceptedSelector(SEL sel)
|
|||||||
- (void)reloadData
|
- (void)reloadData
|
||||||
{
|
{
|
||||||
[_dataController reloadData];
|
[_dataController reloadData];
|
||||||
|
ASDisplayNodePerformBlockOnMainThread(^{
|
||||||
if ([NSThread isMainThread]) {
|
|
||||||
[super reloadData];
|
|
||||||
} else {
|
|
||||||
dispatch_async(dispatch_get_main_queue(), ^{
|
|
||||||
[super reloadData];
|
[super reloadData];
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
- (ASRangeTuningParameters)rangeTuningParameters
|
- (ASRangeTuningParameters)rangeTuningParameters
|
||||||
{
|
{
|
Loading…
x
Reference in New Issue
Block a user