- (void)tabBarController:(UITabBarController *)_tabBarController didSelectViewController:(UIViewController *)viewController
{
//取得user點選的Tab index
NSInteger indexofTab = [_tabBarController.viewControllersindexOfObject:viewController];
if (indexofTab >= 4) //若是Tab大於等於4表示為more button
{
[_tabBarController.moreNavigationControllerpopToRootViewControllerAnimated:NO];//讓more回到第一頁
}
if ([viewController isKindOfClass:[UINavigationControllerclass]]) //讓navController回到第一頁
{
[(UINavigationController*)viewController popToRootViewControllerAnimated:NO];
}
}
沒有留言:
張貼留言