0

I have been working on app that capture images and video and then send it to mail via MFMailComposer. I have created zip file of content and size around 6MB. I want to show loading view when user click on send button and hide mail controller and when mail actually sent i want to show the message via alert. Is there any way to do it? Any help will be appreciated.

4

1 回答 1

1

MFMailComposeViewControllerDelegate如果邮件已发送, 您可以使用方法获取信息:

- (void) mailComposeController:(MFMailComposeViewController *)controller didFinishWithResult:(MFMailComposeResult)result error:(NSError *)error
{

    switch (result)
    {
        case MFMailComposeResultCancelled:
            NSLog(@"Mail cancelled");
            break;
        case MFMailComposeResultSaved:
            NSLog(@"Mail saved");
            break;
        case MFMailComposeResultSent:
            NSLog(@"Mail sent");
            break;
        case MFMailComposeResultFailed:
            NSLog(@"Mail sent failure: %@", [error localizedDescription]);
            break;
        default:
            break;
    }

// Close the Mail Interface
[self dismissViewControllerAnimated:YES completion:NULL];
}

不要忘记添加MFMailComposeViewControllerDelegate到您的.h文件中

于 2014-05-11T10:37:57.427 回答