测试已测试 | ✓ |
语言语言 | Obj-CObjective C |
许可协议 | MIT |
发布时间最后发布 | 2014年12月 |
由Seivan Heidari维护。
此 Pod 被
SHUIKitBlocks
使用,作为许多组件的一部分,用于填补 Foundation、UIKit、CoreLocation、GameKit、MapKit 以及 iOS 应用架构的其他方面的空白。
UINavigationController 的生命周期块 - willShow 和 didShow。一旦 UINavigationController 被移除,块会自动删除,因此不需要清理 - Swizzle Free(™)
pod 'SHNavigationControllerBlocks'
pod 'SHNavigationControllerBlocks', '~> 1.0.0' # for iOS 6
将以下内容放在特定的文件中或项目的 prefix 文件中
#import "UINavigationController+SHNavigationControllerBlocks.h"
或者
#import "SHNavigationControllerBlocks.h"
#pragma mark - Block Definitions
typedef void (^SHNavigationControllerBlock)(UINavigationController * navigationController,
UIViewController * viewController,
BOOL isAnimated);
typedef UIInterfaceOrientation(^SHNavigationControllerOrientationBlock)(UINavigationController * navigationController);
typedef id<UIViewControllerInteractiveTransitioning>
(^SHNavigationControllerInteractiveControllerBlock)(UINavigationController * navigationController,
id<UIViewControllerAnimatedTransitioning> animationController);
typedef id<UIViewControllerAnimatedTransitioning>
(^SHNavigationControllerAnimatedControllerBlock) (UINavigationController * navigationController,
UINavigationControllerOperation operation,
UIViewController * fromVC,
UIViewController * toVC
);
@interface UINavigationController (SHNavigationControllerBlocks)
#pragma mark - Properties
#pragma mark - Setters
-(void)SH_setWillShowViewControllerBlock:(SHNavigationControllerBlock)theBlock;
-(void)SH_setDidShowViewControllerBlock:(SHNavigationControllerBlock)theBlock;
-(void)SH_setPreferredInterfaceOrientationForPresentatationBlock:(SHNavigationControllerOrientationBlock)theBlock;
-(void)SH_setInteractiveControllerBlock:(SHNavigationControllerInteractiveControllerBlock)theBlock;
-(void)SH_setAnimatedControllerBlock:(SHNavigationControllerAnimatedControllerBlock)theBlock;
#pragma mark - Getters
@property(nonatomic,readonly) SHNavigationControllerBlock SH_blockWillShowViewController;
@property(nonatomic,readonly) SHNavigationControllerBlock SH_blockDidShowViewController;
@property(nonatomic,readonly) SHNavigationControllerOrientationBlock SH_blockInterfaceOrientationForPresentation;
@property(nonatomic,readonly) SHNavigationControllerInteractiveControllerBlock SH_blockInteractiveController;
@property(nonatomic,readonly) SHNavigationControllerAnimatedControllerBlock SH_blockAnimatedController;
@end
如果您在项目中使用了 SHNavigationControllerBlocks,我会很高兴听到这方面的消息。
电子邮件:[email protected]
推特:@seivanheidari
SHNavigationControllerBlocks 是 © 2013 Seivan,可以在 MIT 许可证 下自由分发。请参阅 LICENSE.md
文件。