#pragma mark -UITabBarControllerDelegate
🌰是否允许选择不同item触发后续操作,YES 允许,NO不允许
- (BOOL)tabBarController:(UITabBarController *)tabBarController shouldSelectViewController:(UIViewController *)viewController
{
NSLog(@"hello");
return YES;
}
🌰每次点击tabBarItem后触发这个方法(只有点击标签栏中的五个按钮才会触发,MORE里边的不会触发)
- (void)tabBarController:(UITabBarController *)tabBarController didSelectViewController:(UIViewController *)viewController
{
NSLog(@"%@!",viewController.title);
}
🌰当点击moreNaviegationController中的编辑按钮时触发的方法
- (void)tabBarController:(UITabBarController *)tabBarController willBeginCustomizingViewControllers:(NSArray *)viewControllers
{
NSLog(@"biaji");
}
🌰当点击完成按钮的时候,触发此方法
🌰changed : 标记viewController的顺序是否改变
🌰ViewControllers 返回最新的tabBarController中viewControllers
- (void)tabBarController:(UITabBarController *)tabBarController willEndCustomizingViewControllers:(NSArray *)viewControllers changed:(BOOL)changed NS_AVAILABLE_IOS(3_0)
{
if(changed)
{
NSLog(@"change@");
}
else
{
NSLog(@"not change");
}
for(UIViewController *vc in viewControllers)
{
NSLog(@"%@",vc.title);
}
}