#import
#import
#import
#import
#import
@class UIView, UIImage, UINavigationController, UITabBarItem;
@protocol UITabBarControllerDelegate;
#pragma - mark - 声明
NS_CLASS_AVAILABLE_IOS(2_0) @interface UITabBarController : UIViewController
@property(nonatomic,copy) NSArray *viewControllers; // 所有子控制器
- (void)setViewControllers:(NSArray *)viewControllers animated:(BOOL)animated;
@property(nonatomic,assign) UIViewController *selectedViewController; // 选中的控制器
#pragma - mark 通过index切换选中的控制器
@property(nonatomic) NSUInteger selectedIndex;
// 如果子控制器太多。会自动将一部分子控制器放入一个 UINavigationController 中,并显示 More 按钮,不要手动让其显示在界面上,系统自动执行;
@property(nonatomic,readonly) UINavigationController *moreNavigationController;
@property(nonatomic,copy) NSArray *customizableViewControllers;
@property(nonatomic,readonly) UITabBar *tabBar NS_AVAILABLE_IOS(3_0);
@property(nonatomic,assign) id delegate;
@end
#pragma - mark - 代理方法
@protocol UITabBarControllerDelegate
@optional
// 控制器是否能被选中
- (BOOL)tabBarController:(UITabBarController *)tabBarController shouldSelectViewController:(UIViewController *)viewController NS_AVAILABLE_IOS(3_0);
// 已经选中一个控制器后执行的方法
- (void)tabBarController:(UITabBarController *)tabBarController didSelectViewController:(UIViewController *)viewController;
- (void)tabBarController:(UITabBarController *)tabBarController willBeginCustomizingViewControllers:(NSArray *)viewControllers NS_AVAILABLE_IOS(3_0);
- (void)tabBarController:(UITabBarController *)tabBarController willEndCustomizingViewControllers:(NSArray *)viewControllers changed:(BOOL)changed NS_AVAILABLE_IOS(3_0);
- (void)tabBarController:(UITabBarController *)tabBarController didEndCustomizingViewControllers:(NSArray *)viewControllers changed:(BOOL)changed;
- (NSUInteger)tabBarControllerSupportedInterfaceOrientations:(UITabBarController *)tabBarController NS_AVAILABLE_IOS(7_0);
- (UIInterfaceOrientation)tabBarControllerPreferredInterfaceOrientationForPresentation:(UITabBarController *)tabBarController NS_AVAILABLE_IOS(7_0);
- (id )tabBarController:(UITabBarController *)tabBarController
interactionControllerForAnimationController: (id )animationController NS_AVAILABLE_IOS(7_0);
- (id )tabBarController:(UITabBarController *)tabBarController
animationControllerForTransitionFromViewController:(UIViewController *)fromVC
toViewController:(UIViewController *)toVC NS_AVAILABLE_IOS(7_0);
@end
@interface UIViewController (UITabBarControllerItem)
@property(nonatomic,retain) UITabBarItem *tabBarItem;
@property(nonatomic,readonly,retain) UITabBarController *tabBarController;
@end