mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-12-23 22:55:00 +00:00
Use shiny new dequeueReusableCellWithIdentifier:forIndexPath: method in ASTableView
This commit is contained in:
@@ -21,6 +21,8 @@
|
||||
// FIXME: Temporary nonsense import until method names are finalized and exposed
|
||||
#import "ASDisplayNode+Subclasses.h"
|
||||
|
||||
static NSString * const reuseIdentifier = @"_ASCollectionViewCell";
|
||||
|
||||
//#define LOG(...) NSLog(__VA_ARGS__)
|
||||
#define LOG(...)
|
||||
|
||||
@@ -223,6 +225,8 @@ static BOOL _isInterceptedSelector(SEL sel)
|
||||
// If the initial size is 0, expect a size change very soon which is part of the initial configuration
|
||||
// and should not trigger a relayout.
|
||||
_ignoreNodesConstrainedWidthChange = (_nodesConstrainedWidth == 0);
|
||||
|
||||
[self registerClass:_ASTableViewCell.class forCellReuseIdentifier:reuseIdentifier];
|
||||
}
|
||||
|
||||
- (instancetype)initWithFrame:(CGRect)frame style:(UITableViewStyle)style
|
||||
@@ -528,13 +532,8 @@ static BOOL _isInterceptedSelector(SEL sel)
|
||||
|
||||
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
|
||||
{
|
||||
static NSString *reuseIdentifier = @"_ASTableViewCell";
|
||||
|
||||
_ASTableViewCell *cell = [self dequeueReusableCellWithIdentifier:reuseIdentifier];
|
||||
if (!cell) {
|
||||
cell = [[_ASTableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:reuseIdentifier];
|
||||
cell.delegate = self;
|
||||
}
|
||||
_ASTableViewCell *cell = [self dequeueReusableCellWithIdentifier:reuseIdentifier forIndexPath:indexPath];
|
||||
cell.delegate = self;
|
||||
|
||||
ASCellNode *node = [_dataController nodeAtIndexPath:indexPath];
|
||||
[_rangeController configureContentView:cell.contentView forCellNode:node];
|
||||
|
||||
Reference in New Issue
Block a user