HBKit 1.1.0

HBKit 1.1.0

测试已测试
语言语言 Obj-CObjective C
许可证 NOASSERTION
发布最新发布2019年11月

natoto维护。



HBKit 1.1.0

  • 作者:
  • nonato

HBKit

  • 通过 plist 或 json 文件创建一个列表(tableview 或 collectionview)
  • 通过一行创建一个列表

中文文档

使用方式

pod 'HBKit'

基于 HBKit 的其他 pod

 pod 'HBKitRefresh'  #for pull refresh or load more 

 pod 'HBKitWatchDog' #add watchdog to hot reload list

 pod 'HBLaboratory' # laboratory 
 

HBLaboratory

HBKitWatchDog

HBKitRefresh

HBKit use case

从 plist 载入

 
- (void)viewDidLoad
{
    [super viewDidLoad];
    // Do any additional setup after loading the view.
    [self loadplistConfig:@"TestPlist" watch_directory:@"resource"];
}

从 json 文件载入

 
- (void)viewDidLoad {
    [super viewDidLoad]; 
    [self loadjsonfileConfig:@"TestJson" watch_directory:@"resource"]; 
}

通过代码加载

HBKit 示例



@interface RootViewController ()
//step 1
 @property(nonatomic, retain) CELL_STRUCT *cell_struct_normal;
 @property(nonatomic, retain) CELL_STRUCT *cell_struct_sys;
 @property(nonatomic, retain) CELL_STRUCT *cell_struct_xib;
 @property(nonatomic, retain) CELL_STRUCT *cell_struct_plist;
 @property(nonatomic, retain) CELL_STRUCT *cell_struct_autoheight;
 @property(nonatomic, retain) CELL_STRUCT *cell_struct_refresh;
 @property(nonatomic, retain) CELL_STRUCT *cell_struct_normalcollection;
 @property(nonatomic, retain) CELL_STRUCT *cell_struct_collection;
 @property(nonatomic, retain) CELL_STRUCT *cell_struct_kvo;
 @property(nonatomic, retain) CELL_STRUCT *cell_struct_drawcell;
 @property(nonatomic, retain) CELL_STRUCT *cell_struct_copy;
 @property(nonatomic, retain) CELL_STRUCT *cell_struct_testjson;

@property(nonatomic, retain) CELL_STRUCT *cell_struct_testanode;

@end


@implementation RootViewController
DEF_CELL_STRUCT_WITH(testanode, @"测试asyndisplaynode");

- (void)viewDidLoad
{
    [super viewDidLoad];
    self.title = @"HBKit-快速开发引擎";
    [self loadCellstructConfig];
}

- (void)loadCellstructConfig
{
    
    NSInteger rowIndex = 0;
    NSInteger sectionIndex = 0;
    
    self.cell_struct_normal.sectionheight = 30;
    self.cell_struct_normal.sectiontitle = @"常规列表和瀑布流创建方法";
    [self.dataDictionary setObject:self.cell_struct_normal forKey:KEY_INDEXPATH(sectionIndex, rowIndex++)];
    [self.dataDictionary setObject:self.cell_struct_normalcollection forKey:KEY_INDEXPATH(sectionIndex, rowIndex++)];
    
    sectionIndex++,rowIndex = 0;
    self.cell_struct_sys.sectionheight = 20;
    self.cell_struct_sys.sectiontitle = @"HBKit列表和瀑布流创建方法";
    
    [self.dataDictionary setObject:self.cell_struct_sys forKey:KEY_INDEXPATH(sectionIndex, rowIndex++)];
    [self.dataDictionary setObject:self.cell_struct_plist forKey:KEY_INDEXPATH(sectionIndex, rowIndex++)];
    [self.dataDictionary setObject:self.cell_struct_testjson forKey:KEY_INDEXPATH(sectionIndex, rowIndex++)];
    [self.dataDictionary setObject:self.cell_struct_xib forKey:KEY_INDEXPATH(sectionIndex, rowIndex++)]; 
    [self.tableView reloadData];
}

/**
*  响应的CELselect的方法
*/
//step 3

- (IBAction)selectAction:(CELL_STRUCT *)cellstruct
{
    if (cellstruct == self.cell_struct_sys) {
        
        TestSystyleviewController *ctr = [[TestSystyleviewController 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