mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-08-19 20:21:26 +00:00
refactor ASTAbleView initialization code so it also gets initialized when starting from initWithCoder:
This commit is contained in:
parent
1316389f10
commit
c81f5d08fc
@ -129,17 +129,7 @@ static BOOL _isInterceptedSelector(SEL sel)
|
|||||||
#pragma mark -
|
#pragma mark -
|
||||||
#pragma mark Lifecycle
|
#pragma mark Lifecycle
|
||||||
|
|
||||||
- (instancetype)initWithFrame:(CGRect)frame style:(UITableViewStyle)style
|
- (void)configureWithAsyncDataFetching:(BOOL)asyncDataFetchingEnabled {
|
||||||
{
|
|
||||||
return [self initWithFrame:frame style:style asyncDataFetching:NO];
|
|
||||||
}
|
|
||||||
|
|
||||||
- (instancetype)initWithFrame:(CGRect)frame style:(UITableViewStyle)style asyncDataFetching:(BOOL)asyncDataFetchingEnabled
|
|
||||||
{
|
|
||||||
|
|
||||||
if (!(self = [super initWithFrame:frame style:style]))
|
|
||||||
return nil;
|
|
||||||
|
|
||||||
_layoutController = [[ASFlowLayoutController alloc] initWithScrollOption:ASFlowLayoutDirectionVertical];
|
_layoutController = [[ASFlowLayoutController alloc] initWithScrollOption:ASFlowLayoutDirectionVertical];
|
||||||
|
|
||||||
_rangeController = [[ASRangeController alloc] init];
|
_rangeController = [[ASRangeController alloc] init];
|
||||||
@ -155,6 +145,28 @@ static BOOL _isInterceptedSelector(SEL sel)
|
|||||||
|
|
||||||
_leadingScreensForBatching = 1.0;
|
_leadingScreensForBatching = 1.0;
|
||||||
_batchContext = [[ASBatchContext alloc] init];
|
_batchContext = [[ASBatchContext alloc] init];
|
||||||
|
}
|
||||||
|
|
||||||
|
- (instancetype)initWithFrame:(CGRect)frame style:(UITableViewStyle)style
|
||||||
|
{
|
||||||
|
return [self initWithFrame:frame style:style asyncDataFetching:NO];
|
||||||
|
}
|
||||||
|
|
||||||
|
- (instancetype)initWithFrame:(CGRect)frame style:(UITableViewStyle)style asyncDataFetching:(BOOL)asyncDataFetchingEnabled
|
||||||
|
{
|
||||||
|
if (!(self = [super initWithFrame:frame style:style]))
|
||||||
|
return nil;
|
||||||
|
|
||||||
|
[self configureWithAsyncDataFetching:asyncDataFetchingEnabled];
|
||||||
|
|
||||||
|
return self;
|
||||||
|
}
|
||||||
|
|
||||||
|
- (instancetype)initWithCoder:(NSCoder *)aDecoder {
|
||||||
|
if (!(self = [super initWithCoder:aDecoder]))
|
||||||
|
return nil;
|
||||||
|
|
||||||
|
[self configureWithAsyncDataFetching:NO];
|
||||||
|
|
||||||
return self;
|
return self;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user