Deprecated, please use RxCocoa
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.
Life cycle blocks for SHPopoverControllerBlocks - shouldDismiss and didDismiss. The blocks are automatically removed once they SHPopoverControllerBlocks is gone, so it isn't necessary to clean up - Swizzle Free(™)
pod 'SHPopoverControllerBlocks'
Put this either in specific files or your project prefix file
#import "UIPopoverController+SHPopoverControllerBlocks.h"
or
#import "SHPopoverControllerBlocks.h"
#pragma mark -
#pragma mark Block Def
typedef BOOL (^SHPopverControllerShouldDismissBlock)(UIPopoverController * thePopoverController);
typedef void (^SHPopverControllerDidDismissBlock)(UIPopoverController * thePopoverController);
@interface UIPopoverController (SHPopoverControllerBlocks)
#pragma mark -
#pragma mark Properties
#pragma mark -
#pragma mark Setters
-(void)SH_setShouldDismissPopoverBlock:(SHPopverControllerShouldDismissBlock)theBlock;
-(void)SH_setDidDismissPopoverBlock:(SHPopverControllerDidDismissBlock)theBlock;
#pragma mark -
#pragma mark Getters
@property(nonatomic,readonly) SHPopverControllerShouldDismissBlock SH_blockShouldDismissPopoverBlock;
@property(nonatomic,readonly) SHPopverControllerDidDismissBlock SH_blockDidDismissPopoverBlock;
@end
[self.popController SH_setShouldDismissPopoverBlock:^BOOL(UIPopoverController *thePopoverController) {
testShouldDismiss = YES;
dispatch_semaphore_signal(semaphoreShouldDismiss);
return YES;
}];
[self.popController SH_setDidDismissPopoverBlock:^(UIPopoverController *thePopoverController) {
testDidDismiss = YES;
dispatch_semaphore_signal(semaphoreDidDismiss);
}];
If you end up using SHPopoverControllerBlocks in a project, I'd love to hear about it.
email: [email protected]
twitter: @seivanheidari
SHPopoverControllerBlocks is © 2013 Seivan and may be freely
distributed under the MIT license.
See the LICENSE.md
file.