Skip to content
This repository was archived by the owner on Nov 12, 2024. It is now read-only.

Repository files navigation

Deprecated, please use RxCocoa

SHNavigationControllerBlocks

CI StatusVersionPlatformLicense

This pod is used by SHUIKitBlocks as part of many components covering to plug the holes missing from Foundation, UIKit, CoreLocation, GameKit, MapKit and other aspects of an iOS application's architecture.

Overview

Life cycle blocks for UINavigationController - willShow and didShow. The blocks are automatically removed once they UINavigationController is gone, so it isn't necessary to clean up - Swizzle Free(™)

API

Installation

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

Setup

Put this either in specific files or your project prefix file

#import"UINavigationController+SHNavigationControllerBlocks.h"

or

#import"SHNavigationControllerBlocks.h"

API

Properties

#pragma mark - Block Definitions
typedefvoid (^SHNavigationControllerBlock)(UINavigationController * navigationController,
UIViewController * viewController,
BOOL isAnimated);
typedefUIInterfaceOrientation(^SHNavigationControllerOrientationBlock)(UINavigationController * navigationController);
typedefid<UIViewControllerInteractiveTransitioning>
(^SHNavigationControllerInteractiveControllerBlock)(UINavigationController * navigationController,
id<UIViewControllerAnimatedTransitioning> animationController);
typedefid<UIViewControllerAnimatedTransitioning>
(^SHNavigationControllerAnimatedControllerBlock) (UINavigationController * navigationController,
UINavigationControllerOperation operation,
UIViewController * fromVC,
UIViewController * toVC
);
@interfaceUINavigationController (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

Contact

If you end up using SHNavigationControllerBlocks in a project, I'd love to hear about it.

email: seivan.heidari@icloud.com
twitter: @seivanheidari

License

SHNavigationControllerBlocks is © 2013 Seivan and may be freely distributed under the MIT license. See the LICENSE.md file.

About

Block based callbacks for UINavigationController willShow and DidShow

Resources

Stars

1 star

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages