- -(void)makeTabBarHidden:(BOOL)hide {
- // Custom code to hide TabBar
- if ( [tabBarController.view.subviews count] < 2 ) {
- return;
- }
- UIView *contentView;
- if ( [[tabBarController.view.subviews objectAtIndex:0] isKindOfClass:[UITabBar class]] ) {
- contentView = [tabBarController.view.subviews objectAtIndex:1];
- } else {
- contentView = [tabBarController.view.subviews objectAtIndex:0];
- }
- if (hide) {
- contentView.frame = tabBarController.view.bounds;
- } else {
- contentView.frame = CGRectMake(tabBarController.view.bounds.origin.x,
- tabBarController.view.bounds.origin.y,
- tabBarController.view.bounds.size.width,
- tabBarController.view.bounds.size.height -
- tabBarController.tabBar.frame.size.height);
- }
- tabBarController.tabBar.hidden = hide;
- }