Merge pull request #443 from eanagel/astableview-in-xib

Allow ASTableView to be loaded in a xib/storyboard
This commit is contained in:
appleguy
2015-05-16 23:00:50 -10:00

View File

@@ -135,17 +135,7 @@ static BOOL _isInterceptedSelector(SEL sel)
#pragma mark -
#pragma mark Lifecycle
- (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;
- (void)configureWithAsyncDataFetching:(BOOL)asyncDataFetchingEnabled {
_layoutController = [[ASFlowLayoutController alloc] initWithScrollOption:ASFlowLayoutDirectionVertical];
_rangeController = [[ASRangeController alloc] init];
@@ -161,6 +151,28 @@ static BOOL _isInterceptedSelector(SEL sel)
_leadingScreensForBatching = 1.0;
_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;
}