微校APP 开发总结
block函数
1 重点内容
1.1 项目大量使用block函数 函数式编程思想
1.1.1 自定义Button中使用block简化点击事件,首先Button.h文件的声明
typedef void(^IButtonClickBlock)(IButton *);
,
@property(nonatomic,copy)IButtonClickBlock block;
Button .m文件实现方法
-(instancetype)initWithFrame:(CGRect)frame{
if (self=[super initWithFrame:frame]) {
[self addTarget:self action:@selector(Click:) forControlEvents:UIControlEventTouchUpInside];
}
return self;
}
-(void)Click:(IButton *)btn{
if (_block) {
_block(btn);
}
}
在其他文件只需写button.block=^(Button *)button{/***实现代码***/}即可完成点击事件
tableView知识点总结
- 取消cell的分割线
tableView.tableFooterView=[[UIView alloc]init];
- 跳转页面隐藏tabBar
[跳转控制器 setHidesBottomBarWhenPushed:YES];