文章来源:淘论文网   发布者: 毕业设计   浏览量: 33



还可以点击去查询以下关键词:
[TableView]    [deleg]    [毕业]    [dataSource]    [封装]    [TableView deleg毕业ate dataSource封装]   

项目介绍:

JDragonTableManager

iOS UITableView的DataSource和delegate 优化封装

user pod pod 'JDragonTableManager','~> 0.0.2' 基本使用##Controller 方法 #import 'JDragonTableManager.h' #import 'UITableView+JDragonTableManager.h' @interface UITableViewController () @property (weak, nonatomic) IBOutlet UITableView *aTableView; @property (nonatomic,strong) JDragonTableManager *tabDelagate; @property (nonatomic,strong) JDragonTableManager *tabDataSource; @end - (void)viewDidLoad { [super viewDidLoad]; // Do any additional setup after loading the view, typically from a nib. [self setUIConfig]; } -(void)setUIConfig { self.aTableView.estimatedRowHeight = 50; [self.aTableView registerClass:[aTableViewCell class] forCellReuseIdentifier:@'aTableViewCell']; [self.aTableView registerNib:[UINib nibWithNibName:@'bTableViewCell' bundle:nil] forCellReuseIdentifier:@'bTableViewCell']; self.tabDelagate = [self.aTableView JDTab_DelegateWithHeaderHeight:10 footerHeight:10 selectBlock:^(NSIndexPath *indexPath) { NSLog(@'选中'); }]; // 需要实现JDTableManagerDelegate 代理在cell里面 self.tabDataSource = [self.aTableView JDTab_DataSourceWithSource:@[@'111',@'222'] withTabType:NumberOfRowsInSectionCount withVC:self isSection:true reuseIdentifier:@'aTableViewCell']; /* //第二种方式,开题报告,可以不带原数据 self.tabDataSource = [self.aTableView JDTab_DataSourceWithTabType:NumberOfRowsInSectionCount withVC:self isSection:true reuseIdentifier:@'aTableViewCell']; [self.tabDataSource updateReloadData:@[@'111',@'222']]; */ } ##Cell方法 #import 'JDragonTableManager.h' @interface aTableViewCell ()<JDTableManagerDelegate> @end @implementation aTableViewCell - (void)awakeFromNib { [super awakeFromNib]; // Initialization code } -(void)PrepareToWithAppear:(NSObject *)data WithCurentVC:(UIViewController *)curentVC WithIndexPath:(NSIndexPath *)indexPath { self.textLabel.text = [data isKindOfClass:[NSString class]]?(NSString*)data:data.description; NSLog(@'data====%@',data); } @end 详细请看demo

如果大家觉得好用的话,请抖抖您的小手,论文,给个star。 https://github.com/lyc59621/JDragonTableManager


这里还有:


还可以点击去查询:
[TableView]    [deleg]    [毕业]    [dataSource]    [封装]    [TableView deleg毕业ate dataSource封装]   

请扫码加微信 微信号:sj52abcd


下载地址: http://www.taolw.com/down/7738.docx
  • 上一篇:JDragonSoap A定制FNetworking 封装
  • 下一篇:MBProgres毕业设计sHUD 封装