续 iOS引导登录、登录引导、login(点击某个功能按钮需要登录并且登录完成后自动跳转到要去的功能实现方法)(一)
5.2枚举值声明改为
typedef enum JumpType{ ROUTE_MANAGER= 0, }MYJumpType;
5.3三个按钮的点击事件改为
//三个按钮的点击事件 - (void)btnClicked:(UIButton *)btnn{ if (btnn.tag == 0) { [RouteManager pushViewControllerWithOriginViewController:self loginFlag:@"Y" identifier:@"ZhuanZhangViewController" otherParameters:nil]; }else if(btnn.tag == 1){ [RouteManager pushViewControllerWithOriginViewController:self loginFlag:@"Y" identifier:@"HuiKuanViewController" otherParameters:nil]; }else{ [RouteManager pushViewControllerWithOriginViewController:self loginFlag:@"Y" identifier:@"JieKuanViewController" otherParameters:nil]; } }
5.4登录按钮的事件
- (IBAction)loginBtnClicked:(id)sender { if (self.userName.text.length > 0 && self.passWord.text.length > 0) { APPLICATION.isLogin = YES; [self dismissViewControllerAnimated:YES completion:^{ if(APPLICATION.jumpType == ROUTE_MANAGER){ [[NSNotificationCenter defaultCenter] postNotificationName:@"ROUTE_MANAGER" object:nil ]; } }]; }else{ UIAlertView *alertView = [[UIAlertView alloc]initWithTitle:@"提示" message:@"输入有误" delegate:nil cancelButtonTitle:@"确定" otherButtonTitles:nil, nil nil]; [alertView show]; } }