SMRecordViewController *vc = [SMRecordViewController pushWithData:[SMRecordPushDataModel initWitPreviousVC:self]];
SMRecordPushDataModel *model = [SMRecordPushDataModel initWitPreviousVC:self.thePreviousVC];
model.isHook = isHookModel;
model.shouldSMRecordAlertView = NO;
SMRecordViewController *vc = [SMRecordViewController pushWithData:model];
关键有个传参的功能
大的都要封装
不许直接push
a push b
a给b传参
b也可能要回传啊
loginmanger 里面有button 有对应的网络等其他逻辑 你业务层只需要调用manger的view函数就行了,包含了按钮view,登录请求m,登录逻辑c
hook button事件,就是交换button的点击事件,然后自己想怎么写逻辑就怎么写,关键在button的tag。
事件截获是最好的 ,就截获所有的button点击事件,只要你这个button有先走login的属性,那就优先走login,跟控制器没关系 runtime截获
比如一个那button 他的tag是99999,那么就可以认定这是一个带有login的tag,runtime先进行截获 看button是不是tag 9999
//要求没有登录的时候 要求button点击先提示用户登录
那你初始化一个button 给他tag 是9999 那么这种button就是带登录逻辑button 优先处理登录逻辑啊
只需要告诉他,如果带登录逻辑的button写上tag 9999就行 [self checkLogin] 就是先检查有没有登陆