Deprecated please use RxCocoa with RxSwift
Composer Completion block for MFMailComposeViewController and MFMessageComposeViewController. The blocks are automatically removed once the alert is gone, so it isn't necessary to clean up - Swizzle Free(™)
pod 'SHMessageUIBlocks'
Put this either in specific files or your project prefix file
For all controllers
#import "SHMessageUIBlocks.h"
For just Mail
#import "MFMailComposeViewController+SHMessageUIBlocks.h"
For just Message
#import "MFMessageComposeViewController+SHMessageUIBlocks.h"
#pragma mark -
#pragma mark Init
+(instancetype)SH_mailComposeViewController;
+(instancetype)SH_mailComposeViewControllerWithBlock:(SHMailComposerBlock)theBlock;
#pragma mark -
#pragma mark Block Defs
typedef void (^SHMailComposerBlock)(MFMailComposeViewController * theController,
MFMailComposeResult theResults,
NSError * theError);
#pragma mark -
#pragma mark Properties
#pragma mark -
#pragma mark Setters
-(void)SH_setComposerCompletionBlock:(SHMailComposerBlock)theBlock;
#pragma mark -
#pragma mark Getters
@property(nonatomic,readonly) SHMailComposerBlock SH_blockComposerCompletion;
#pragma mark -
#pragma mark Init
+(instancetype)SH_messageComposeViewController;
+(instancetype)SH_messageComposeViewControllerWithBlock:(SHMessageComposerBlock)theBlock;
#pragma mark -
#pragma mark Block Defs
typedef void (^SHMessageComposerBlock)(MFMessageComposeViewController * theController,
MessageComposeResult theResults);
#pragma mark -
#pragma mark Properties
#pragma mark -
#pragma mark Setters
-(void)SH_setComposerCompletionBlock:(SHMessageComposerBlock)theBlock;
#pragma mark -
#pragma mark Getters
@property(nonatomic,readonly) SHMessageComposerBlock SH_blockComposerCompletion;
If you end up using SHMessageUIBlocks in a project, I'd love to hear about it.
email: seivan.heidari@icloud.com
twitter: @seivanheidari
SHMessageUIBlocks is © 2013 Seivan and may be freely
distributed under the MIT license.
See the LICENSE.md
file.