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

CompletionBlocks for MFMailComposeViewController and MFMessageComposeViewController (MessageUI framework)

License

Notifications You must be signed in to change notification settings

seivan-archives/SHMessageUIBlocks

Repository files navigation

Deprecated please use RxCocoa with RxSwift

SHMessageUIBlocks

CI Status Version Platform License

Overview

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(™)

API

Installation

pod 'SHMessageUIBlocks'

Setup

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"

API

Init Mail

#pragma mark -
#pragma mark Init
+(instancetype)SH_mailComposeViewController;
+(instancetype)SH_mailComposeViewControllerWithBlock:(SHMailComposerBlock)theBlock;

Properties Mail

#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;

Init Message

#pragma mark -
#pragma mark Init
+(instancetype)SH_messageComposeViewController;
+(instancetype)SH_messageComposeViewControllerWithBlock:(SHMessageComposerBlock)theBlock;

Properties Message

#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;

Contact

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

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

License

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

About

CompletionBlocks for MFMailComposeViewController and MFMessageComposeViewController (MessageUI framework)

Resources

License

Stars

Watchers

Forks

Packages

No packages published