mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-12-16 11:20:18 +00:00
Proposed version 1
This commit is contained in:
parent
da2cbf4644
commit
bc92c64e8c
@ -423,14 +423,12 @@ static NSString * const kCellReuseIdentifier = @"_ASCollectionViewCell";
|
|||||||
- (void)insertSections:(NSIndexSet *)sections
|
- (void)insertSections:(NSIndexSet *)sections
|
||||||
{
|
{
|
||||||
ASDisplayNodeAssertMainThread();
|
ASDisplayNodeAssertMainThread();
|
||||||
[_layoutFacilitator collectionViewInsertingSectionsAtIndexSet:sections];
|
|
||||||
[_dataController insertSections:sections withAnimationOptions:kASCollectionViewAnimationNone];
|
[_dataController insertSections:sections withAnimationOptions:kASCollectionViewAnimationNone];
|
||||||
}
|
}
|
||||||
|
|
||||||
- (void)deleteSections:(NSIndexSet *)sections
|
- (void)deleteSections:(NSIndexSet *)sections
|
||||||
{
|
{
|
||||||
ASDisplayNodeAssertMainThread();
|
ASDisplayNodeAssertMainThread();
|
||||||
[_layoutFacilitator collectionViewDeletingSectionsAtIndexSet:sections];
|
|
||||||
[_dataController deleteSections:sections withAnimationOptions:kASCollectionViewAnimationNone];
|
[_dataController deleteSections:sections withAnimationOptions:kASCollectionViewAnimationNone];
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -449,7 +447,6 @@ static NSString * const kCellReuseIdentifier = @"_ASCollectionViewCell";
|
|||||||
- (void)insertItemsAtIndexPaths:(NSArray *)indexPaths
|
- (void)insertItemsAtIndexPaths:(NSArray *)indexPaths
|
||||||
{
|
{
|
||||||
ASDisplayNodeAssertMainThread();
|
ASDisplayNodeAssertMainThread();
|
||||||
[_layoutFacilitator collectionViewInsertingCellAtIndexPaths:indexPaths];
|
|
||||||
[_dataController insertRowsAtIndexPaths:indexPaths withAnimationOptions:kASCollectionViewAnimationNone];
|
[_dataController insertRowsAtIndexPaths:indexPaths withAnimationOptions:kASCollectionViewAnimationNone];
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -847,7 +844,7 @@ static NSString * const kCellReuseIdentifier = @"_ASCollectionViewCell";
|
|||||||
- (void)rangeController:(ASRangeController *)rangeController didEndUpdatesAnimated:(BOOL)animated completion:(void (^)(BOOL))completion
|
- (void)rangeController:(ASRangeController *)rangeController didEndUpdatesAnimated:(BOOL)animated completion:(void (^)(BOOL))completion
|
||||||
{
|
{
|
||||||
ASDisplayNodeAssertMainThread();
|
ASDisplayNodeAssertMainThread();
|
||||||
|
|
||||||
if (!self.asyncDataSource || _superIsPendingDataLoad) {
|
if (!self.asyncDataSource || _superIsPendingDataLoad) {
|
||||||
if (completion) {
|
if (completion) {
|
||||||
completion(NO);
|
completion(NO);
|
||||||
@ -870,7 +867,7 @@ static NSString * const kCellReuseIdentifier = @"_ASCollectionViewCell";
|
|||||||
- (void)rangeController:(ASRangeController *)rangeController didInsertNodes:(NSArray *)nodes atIndexPaths:(NSArray *)indexPaths withAnimationOptions:(ASDataControllerAnimationOptions)animationOptions
|
- (void)rangeController:(ASRangeController *)rangeController didInsertNodes:(NSArray *)nodes atIndexPaths:(NSArray *)indexPaths withAnimationOptions:(ASDataControllerAnimationOptions)animationOptions
|
||||||
{
|
{
|
||||||
ASDisplayNodeAssertMainThread();
|
ASDisplayNodeAssertMainThread();
|
||||||
|
[_layoutFacilitator collectionViewEditingCellsAtIndexPaths:indexPaths];
|
||||||
if (!self.asyncDataSource || _superIsPendingDataLoad) {
|
if (!self.asyncDataSource || _superIsPendingDataLoad) {
|
||||||
return; // if the asyncDataSource has become invalid while we are processing, ignore this request to avoid crashes
|
return; // if the asyncDataSource has become invalid while we are processing, ignore this request to avoid crashes
|
||||||
}
|
}
|
||||||
@ -889,7 +886,7 @@ static NSString * const kCellReuseIdentifier = @"_ASCollectionViewCell";
|
|||||||
- (void)rangeController:(ASRangeController *)rangeController didDeleteNodes:(NSArray *)nodes atIndexPaths:(NSArray *)indexPaths withAnimationOptions:(ASDataControllerAnimationOptions)animationOptions
|
- (void)rangeController:(ASRangeController *)rangeController didDeleteNodes:(NSArray *)nodes atIndexPaths:(NSArray *)indexPaths withAnimationOptions:(ASDataControllerAnimationOptions)animationOptions
|
||||||
{
|
{
|
||||||
ASDisplayNodeAssertMainThread();
|
ASDisplayNodeAssertMainThread();
|
||||||
|
[_layoutFacilitator collectionViewEditingCellsAtIndexPaths:indexPaths];
|
||||||
if (!self.asyncDataSource || _superIsPendingDataLoad) {
|
if (!self.asyncDataSource || _superIsPendingDataLoad) {
|
||||||
return; // if the asyncDataSource has become invalid while we are processing, ignore this request to avoid crashes
|
return; // if the asyncDataSource has become invalid while we are processing, ignore this request to avoid crashes
|
||||||
}
|
}
|
||||||
@ -908,7 +905,7 @@ static NSString * const kCellReuseIdentifier = @"_ASCollectionViewCell";
|
|||||||
- (void)rangeController:(ASRangeController *)rangeController didInsertSectionsAtIndexSet:(NSIndexSet *)indexSet withAnimationOptions:(ASDataControllerAnimationOptions)animationOptions
|
- (void)rangeController:(ASRangeController *)rangeController didInsertSectionsAtIndexSet:(NSIndexSet *)indexSet withAnimationOptions:(ASDataControllerAnimationOptions)animationOptions
|
||||||
{
|
{
|
||||||
ASDisplayNodeAssertMainThread();
|
ASDisplayNodeAssertMainThread();
|
||||||
|
[_layoutFacilitator collectionViewEditingSectionsAtIndexSet:indexSet];
|
||||||
if (!self.asyncDataSource || _superIsPendingDataLoad) {
|
if (!self.asyncDataSource || _superIsPendingDataLoad) {
|
||||||
return; // if the asyncDataSource has become invalid while we are processing, ignore this request to avoid crashes
|
return; // if the asyncDataSource has become invalid while we are processing, ignore this request to avoid crashes
|
||||||
}
|
}
|
||||||
@ -927,7 +924,7 @@ static NSString * const kCellReuseIdentifier = @"_ASCollectionViewCell";
|
|||||||
- (void)rangeController:(ASRangeController *)rangeController didDeleteSectionsAtIndexSet:(NSIndexSet *)indexSet withAnimationOptions:(ASDataControllerAnimationOptions)animationOptions
|
- (void)rangeController:(ASRangeController *)rangeController didDeleteSectionsAtIndexSet:(NSIndexSet *)indexSet withAnimationOptions:(ASDataControllerAnimationOptions)animationOptions
|
||||||
{
|
{
|
||||||
ASDisplayNodeAssertMainThread();
|
ASDisplayNodeAssertMainThread();
|
||||||
|
[_layoutFacilitator collectionViewEditingSectionsAtIndexSet:indexSet];
|
||||||
if (!self.asyncDataSource || _superIsPendingDataLoad) {
|
if (!self.asyncDataSource || _superIsPendingDataLoad) {
|
||||||
return; // if the asyncDataSource has become invalid while we are processing, ignore this request to avoid crashes
|
return; // if the asyncDataSource has become invalid while we are processing, ignore this request to avoid crashes
|
||||||
}
|
}
|
||||||
|
|||||||
@ -11,9 +11,8 @@
|
|||||||
|
|
||||||
@protocol ASCollectionViewLayoutFacilitatorProtocol <NSObject>
|
@protocol ASCollectionViewLayoutFacilitatorProtocol <NSObject>
|
||||||
|
|
||||||
- (void)collectionViewInsertingCellAtIndexPaths:(NSArray *)indexPaths;
|
- (void)collectionViewEditingCellsAtIndexPaths:(NSArray *)indexPaths;
|
||||||
- (void)collectionViewInsertingSectionsAtIndexSet:(NSIndexSet *)indexes;
|
- (void)collectionViewEditingSectionsAtIndexSet:(NSIndexSet *)indexes;
|
||||||
- (void)collectionViewDeletingSectionsAtIndexSet:(NSIndexSet *)indexes;
|
|
||||||
|
|
||||||
@end
|
@end
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user