Latest | 0.6.32 |
---|---|
Homepage | https://github.com/Natoto/HBFastTableViewCotroller |
License | MIT |
Platforms | ios 7.0, requires ARC |
Authors |
HBFastTableViewController
- The easiest way to create tableview
- 用法最简单的创建tableview新框架
用法
- 添加主工程
- pod ‘HBKit’
- pod ‘HBKitRefresh’ #添加上下拉刷新
- pod ‘HBKitWatchDog’ #添加watchdog 实时刷新
- OR
- pod "HBKit", :git=>’‘0.6.32″ target=”_blank”>https://github.com/Natoto/HBFastTableViewCotroller.git’,:tag=>’0.6.32‘
- pod "HBKitWatchDog", :git=>’https://github.com/Natoto/HBFastTableViewCotroller.git‘
从json中加载
- (void)viewDidLoad {
[super viewDidLoad];
[self loadjsonfileConfig:@"TestJson" watch_directory:@"resource"];
}
代码加载
@interface ViewController ()
//step 1
AS_CELL_STRUCT_COMMON(sys)
AS_CELL_STRUCT_COMMON(xib)
AS_CELL_STRUCT_COMMON(autoheight)
AS_CELL_STRUCT_COMMON(refresh)
@end
@implementation ViewController
//step 2
GET_CELL_STRUCT_WITH(sys, HBTABLE-系统控件)
GET_CELL_STRUCT_WITH(xib, HBTABLE-加载XIB)
GET_CELL_STRUCT_WITH(autoheight, HBTABLE-自动高度)
GET_CELL_STRUCT_WITH(refresh, HBTABLE-上下拉)
/**
* 响应的CELselect的方法
*/
//step 3
GET_CELL_SELECT_ACTION(cellstruct)
{
if(cellstruct == self.cell_struct_sys)
{
SystyleviewController * ctr = [[SystyleviewController alloc] init];
[self.navigationController pushViewController:ctr animated:YES];
}
else if(cellstruct == self.cell_struct_xib)
{
TESTXIBViewController * ctr = [[TESTXIBViewController alloc] init];
[self.navigationController pushViewController:ctr animated:YES];
}
}
//step4 OK
系统风格
- (void)viewDidLoad {
[super viewDidLoad];
self.title = @"系统TABLE STYLE";
for (int index = 0; index < 10; index ++) {
NSString * title = [NSString stringWithFormat:@"cell %d",index];
NSString * detail = [NSString stringWithFormat:@"detail cell %d",index];
CELL_STRUCT * cellstruct = [CELL_STRUCT_Common cell_x_x_struct:title detailvalue:detail target:self selectAction:@selector(cellselect:)];
cellstruct.sectionheight = 40;
cellstruct.sectioncolor = value_cellstruct_blue;
cellstruct.sectiontitle = @"SECTION 0";
cellstruct.cellheight = 60;
cellstruct.picture = @"profile";
cellstruct.CellStyleValue = index%3;
cellstruct.accessory = index%2;
cellstruct.selectionStyle = index%2;
[cellstruct.dictionary setObject:HBRandomColor forKey:key_cellstruct_background];
[self.dataDictionary setObject:cellstruct forKey:KEY_INDEXPATH(0, index)];
}
for (int index = 0; index < 10; index ++) {
NSString * title = [NSString stringWithFormat:@"cell %d",index];
NSString * detail = [NSString stringWithFormat:@"detail cell %d",index];
CELL_STRUCT * cellstruct = [CELL_STRUCT_Common cell_x_x_struct:title detailvalue:detail target:self selectAction:@selector(cellselect:)];
cellstruct.cellheight = 60;
cellstruct.sectionheight = 30;
cellstruct.sectiontitle = @"SECTION 1";
cellstruct.picture = @"profile";
cellstruct.CellStyleValue = index%3;
cellstruct.accessory = index%2;
cellstruct.selectionStyle = index%2;
[cellstruct.dictionary setObject:HBRandomColor forKey:key_cellstruct_background];
[self.dataDictionary setObject:cellstruct forKey:KEY_INDEXPATH(1, index)];
}
// Do any additional setup after loading the view.
}
Latest podspec
{ "name": "HBKit", "version": "0.6.32", "summary": "A Fast Style TableViewController.", "homepage": "https://github.com/Natoto/HBFastTableViewCotroller", "license": "MIT", "authors": { "nonato ": "[email protected]" }, "platforms": { "ios": "7.0" }, "source": { "git": "https://github.com/Natoto/HBFastTableViewCotroller.git", "tag": "0.6.32" }, "source_files": "HBKit/**/*.{h,m,plist}", "requires_arc": true }
Thu, 09 Feb 2017 20:40:03 +0000