mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-12-03 21:16:35 +00:00
make reloadData thread safe
This commit is contained in:
parent
daedf73f20
commit
77113c6698
@ -135,7 +135,13 @@ static BOOL _isInterceptedSelector(SEL sel)
|
|||||||
{
|
{
|
||||||
[_dataController reloadData];
|
[_dataController reloadData];
|
||||||
|
|
||||||
[super reloadData];
|
if ([NSThread isMainThread]) {
|
||||||
|
[super reloadData];
|
||||||
|
} else {
|
||||||
|
dispatch_async(dispatch_get_main_queue(), ^{
|
||||||
|
[super reloadData];
|
||||||
|
});
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
- (void)setDataSource:(id<UICollectionViewDataSource>)dataSource
|
- (void)setDataSource:(id<UICollectionViewDataSource>)dataSource
|
||||||
|
|||||||
@ -186,7 +186,13 @@ static BOOL _isInterceptedSelector(SEL sel)
|
|||||||
{
|
{
|
||||||
[_dataController reloadData];
|
[_dataController reloadData];
|
||||||
|
|
||||||
[super reloadData];
|
if ([NSThread isMainThread]) {
|
||||||
|
[super reloadData];
|
||||||
|
} else {
|
||||||
|
dispatch_async(dispatch_get_main_queue(), ^{
|
||||||
|
[super reloadData];
|
||||||
|
});
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
- (ASRangeTuningParameters)rangeTuningParameters
|
- (ASRangeTuningParameters)rangeTuningParameters
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user