#import <UIKit/UIKit.h>
@interface BaseTableView : UITableView<UITableViewDataSource,UITableViewDelegate>
//隐藏上拉刷新空间
- (void)HiddenTableViewFooterViewWithTotalCount:(NSInteger)totalCount withPageNo:(NSInteger)pageNo;
//结束上下拉刷新
- (void)endRefreshAction;
@end
#import "BaseTableView.h"
@interface BaseTableView ()
@end
@implementation BaseTableView
- (id)initWithFrame:(CGRect)frame style:(UITableViewStyle)style
{
self = [super initWithFrame:frame style:style];
if (self) {
self.delegate = self;
self.dataSource = self;
self.backgroundColor = colorForClear;
self.separatorStyle = UITableViewCellSeparatorStyleNone;
}
return self;
}
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
{
return 0;
}
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
return nil;
}
- (void)HiddenTableViewFooterViewWithTotalCount:(NSInteger)totalCount withPageNo:(NSInteger)pageNo
{
if (totalCount/PageSize > pageNo+1 || (((totalCount/PageSize == pageNo+1) != 0) && (totalCount%PageSize != 0))) {
self.footerHidden = NO;
}else {
self.footerHidden = YES;
}
}
- (void)endRefreshAction
{
[self headerEndRefreshing];
[self footerEndRefreshing];
}
@end