iOS 系统tabbarcontroller拦截选中事件
2017-06-05 本文已影响946人
木_风
- (BOOL)tabBarController:(UITabBarController*)tabBarController shouldSelectViewController:(UIViewController*)viewController
{
NSLog(@"viewcontoller===%@",viewController.childViewControllers);
if([[viewController.childViewControllersobjectAtIndex:0]isKindOfClass:[FOLLOWViewControllerclass]]&&[[UserObjectsharedInstance].login_statuesintValue]!=1)
{
[JXTAlertToolsshowAlertWith:selftitle:@""message:@"你还没登录,请去登录吧."callbackBlock:^(NSIntegerindex)
{
if(index==0)
{
[GlobalObjectexitLogin];
}
}cancelButtonTitle:@"确定"destructiveButtonTitle:@"取消"otherButtonTitles:nil,nil];
returnNO;
}
returnYES;
}