SHNavigationControllerBlocks 2.1.1

SHNavigationControllerBlocks 2.1.1

测试已测试
语言语言 Obj-CObjective C
许可协议 MIT
发布时间最后发布2014年12月

Seivan Heidari维护。



  • Seivan Heidari

此 Pod 被 SHUIKitBlocks 使用,作为许多组件的一部分,用于填补 Foundation、UIKit、CoreLocation、GameKit、MapKit 以及 iOS 应用架构的其他方面的空白。

概述

UINavigationController 的生命周期块 - willShow 和 didShow。一旦 UINavigationController 被移除,块会自动删除,因此不需要清理 - Swizzle Free(™)

API

属性

安装

pod 'SHNavigationControllerBlocks' 
pod 'SHNavigationControllerBlocks', '~> 1.0.0' # for iOS 6

设置

将以下内容放在特定的文件中或项目的 prefix 文件中

#import "UINavigationController+SHNavigationControllerBlocks.h"

或者

#import "SHNavigationControllerBlocks.h"

API

属性

#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 文件。