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.

user2996143
  • 113
  • 1
  • 9

1 Answers1

1

You can use the MFMailComposeViewControllerDelegate Methods to get info if the mail has been sent:

- (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];
}

Don't forget to add the MFMailComposeViewControllerDelegate to your .h file

lukas
  • 2,300
  • 6
  • 28
  • 41