1.DataSource瘦身是很重要的部分:具体就是把UITableView中DataSource单独抽离出来,然后单独建类,通过block或者delegate的方式进行回调!
1.png
调用方法如下:
屏幕快照 2017-10-18 下午4.02.39.png
2.model处理部分业务逻辑
3.网络请求分离出来然后回调complete
4.页面跳转统一化,不引用其他的类,根据类名封装直接调用,即可
//navigation跳转
- (void)pushNextController:(NSString *)className valuesForKey:(NSDictionary<NSString *, id> *)dic isHidesBottomBar:(BOOL)isHides {
Class object = NSClassFromString(className);
UIViewController *nextVC = [[object alloc] init];
if (nextVC) {
//tabbar是否隐藏问题
nextVC.hidesBottomBarWhenPushed = isHides;
//传值用的
if (dic) {
[nextVC setValuesForKeysWithDictionary:dic];
}
//跳转
[self.navigationController pushViewController:nextVC animated:YES];
}
else {
//展示:没有该类防止崩溃!
[DJWUtil showTipsWithHUD:@"没有该类" showTime:1.5f];
}
}
5.View页面交给View自己处理,不要写没必要的布局在Controller里面