mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-12-22 22:25:57 +00:00
[ASTableView] Add retainedLayer a la collection view (#1896)
This commit is contained in:
@@ -11,6 +11,7 @@
|
|||||||
#import "ASTableViewInternal.h"
|
#import "ASTableViewInternal.h"
|
||||||
|
|
||||||
#import "ASAssert.h"
|
#import "ASAssert.h"
|
||||||
|
#import "ASAvailability.h"
|
||||||
#import "ASBatchFetching.h"
|
#import "ASBatchFetching.h"
|
||||||
#import "ASCellNode+Internal.h"
|
#import "ASCellNode+Internal.h"
|
||||||
#import "ASChangeSetDataController.h"
|
#import "ASChangeSetDataController.h"
|
||||||
@@ -111,6 +112,15 @@ static NSString * const kCellReuseIdentifier = @"_ASTableViewCell";
|
|||||||
CGFloat _contentOffsetAdjustment;
|
CGFloat _contentOffsetAdjustment;
|
||||||
|
|
||||||
CGPoint _deceleratingVelocity;
|
CGPoint _deceleratingVelocity;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Our layer, retained. Under iOS < 9, when table views are removed from the hierarchy,
|
||||||
|
* their layers may be deallocated and become dangling pointers. This puts the table view
|
||||||
|
* into a very dangerous state where pretty much any call will crash it. So we manually retain our layer.
|
||||||
|
*
|
||||||
|
* You should never access this, and it will be nil under iOS >= 9.
|
||||||
|
*/
|
||||||
|
CALayer *_retainedLayer;
|
||||||
|
|
||||||
CGFloat _nodesConstrainedWidth;
|
CGFloat _nodesConstrainedWidth;
|
||||||
BOOL _ignoreNodesConstrainedWidthChange;
|
BOOL _ignoreNodesConstrainedWidthChange;
|
||||||
@@ -235,6 +245,10 @@ static NSString * const kCellReuseIdentifier = @"_ASTableViewCell";
|
|||||||
self.strongTableNode = tableNode;
|
self.strongTableNode = tableNode;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!AS_AT_LEAST_IOS9) {
|
||||||
|
_retainedLayer = self.layer;
|
||||||
|
}
|
||||||
|
|
||||||
return self;
|
return self;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user