EasyMailSender 0.0.2

EasyMailSender 0.0.2

测试测试版
语言语言 Obj-CObjective C
许可证 MIT
发布最新发布2015 年 10 月

azuakuraru 维护。



  • 作者:
  • azu

通过 MFMailComposeViewController 发送邮件非常简单。

你无需担心 MFMailComposeViewControllerDelegate,可以编写代码块。

安装

pod 'EasyMailSender'

使用

  1. 设置 MFMailComposeViewController
  2. 调用 showFromViewController:
- (IBAction)handleMailButton:(id) sender {
    NSString *attachedText = @"text";
    EasyMailAlertSender *mailSender = [EasyMailAlertSender easyMail:^(MFMailComposeViewController *controller) {
        // Setup
        [controller addAttachmentData:[attachedText dataUsingEncoding:NSUTF8StringEncoding] mimeType:@"plain/text" fileName:@"test.txt"];
    } complete:^(MFMailComposeViewController *controller, MFMailComposeResult result, NSError *error) {
        // When Sent/Cancel - MFMailComposeViewControllerDelegate action
        [controller dismissViewControllerAnimated:YES completion:nil];
    }];
    [mailSender showFromViewController:self];
}

贡献

  1. 分叉它!
  2. 创建你的功能分支: git checkout -b my-new-feature
  3. 提交你的更改: git commit -am 'Add some feature'
  4. 上传到分支: git push origin my-new-feature
  5. 提交拉取请求 :D

许可证

MIT