测试已测试 | ✓ |
Lang语言 | Obj-CObjective C |
许可证 | MIT |
发布最新发布 | 2014年12月 |
由 Seivan Heidari 维护。
此库是
SHUIKitBlocks
的一部分,包含许多组件,用于填补 Foundation、UIKit、CoreLocation、GameKit、MapKit 和 iOS 应用架构其他方面的空白。
UITabBarController 的生命周期块。当 UITabBarController 消失时,块会自动移除,因此无需清理 - Swizzle Free(™)
pod 'SHTabBarControllerBlocks'
pod 'SHTabBarControllerBlocks', '~> 1.1.0' # for iOS 6
将此代码放入特定文件中或您的项目前缀文件中:
#import "UITabBarController+SHTabBarControllerBlocks.h"
或
#import "SHTabBarControllerBlocks.h"
#pragma mark - Block Defintions
typedef BOOL (^SHTabBarControllerPredicateBlock)(UITabBarController * theTabBarController,
UIViewController * theViewController);
typedef void (^SHTabBarControllerBlock)(UITabBarController * theTabBarController,
UIViewController * theViewController);
typedef void (^SHTabBarControllerCustomizingBlock)(UITabBarController * theTabBarController,
NSArray * theViewControllers);
typedef void (^SHTabBarControllerCustomizingWithChangeBlock)(UITabBarController * theTabBarController,
NSArray * theViewControllers,
BOOL isChanged);
typedef id<UIViewControllerInteractiveTransitioning>
(^SHTabBarControllerInteractiveControllerBlock)(UITabBarController * tabBarController,
id<UIViewControllerAnimatedTransitioning> animationController
);
typedef id<UIViewControllerAnimatedTransitioning>
(^SHTabBarControllerAnimatedControllerBlock) (UITabBarController * tabBarController,
UIViewController * fromVC,
UIViewController * toVC
);
@interface UITabBarController (SHTabBarControllerBlocks)
#pragma mark - Properties
#pragma mark - Setters
-(void)SH_setShouldSelectViewControllerBlock:(SHTabBarControllerPredicateBlock)theBlock;
-(void)SH_setDidSelectViewControllerBlock:(SHTabBarControllerBlock)theBlock;
-(void)SH_setWillBeginCustomizingViewControllersBlock:(SHTabBarControllerCustomizingBlock)theBlock;
-(void)SH_setWillEndCustomizingViewControllersBlock:(SHTabBarControllerCustomizingWithChangeBlock)theBlock;
-(void)SH_setDidEndCustomizingViewControllersBlock:(SHTabBarControllerCustomizingWithChangeBlock)theBlock;
-(void)SH_setInteractiveControllerBlock:(SHTabBarControllerInteractiveControllerBlock)theBlock;
-(void)SH_setAnimatedControllerBlock:(SHTabBarControllerAnimatedControllerBlock)theBlock;
#pragma mark - Getters
@property(nonatomic,readonly) SHTabBarControllerPredicateBlock SH_blockShouldSelectViewController;
@property(nonatomic,readonly) SHTabBarControllerBlock SH_blockDidSelectViewController;
@property(nonatomic,readonly) SHTabBarControllerCustomizingBlock SH_blockWillBeginCustomizingViewControllers;
@property(nonatomic,readonly) SHTabBarControllerCustomizingWithChangeBlock SH_blockWillEndCustomizingViewControllers;
@property(nonatomic,readonly) SHTabBarControllerCustomizingWithChangeBlock SH_blockDidEndCustomizingViewControllers;
@property(nonatomic,readonly) SHTabBarControllerInteractiveControllerBlock SH_blockInteractiveController;
@property(nonatomic,readonly) SHTabBarControllerAnimatedControllerBlock SH_blockAnimatedController;
@end
如果您在项目中使用了 SHTabBarControllerBlocks,我很乐意听听您的意见。
电子邮件:[email protected]
Twitter:@seivanheidari
SHTabBarControllerBlocks 是 © 2013 Seivan,可以在 MIT 许可证下自由分发。请参阅 LICENSE.md
文件。