Question

I want to present a modal mail dialogue like so in the iPad app:

MFMailComposeViewController* picker = [[MFMailComposeViewController alloc] init];
picker.mailComposeDelegate = self;          
[picker setSubject:title];
[picker setMessageBody:[NSString stringWithFormat:[self emailBody], title, [link absoluteString]] isHTML:YES];
[self.viewController presentModalViewController:picker animated:YES];

The following delegate is called when the user sends/cancels:

- (void) mailComposeController:(MFMailComposeViewController*)controller didFinishWithResult:(MFMailComposeResult)result error:(NSError*)error { 
    [self.viewController dismissModalViewControllerAnimated:YES];
}

This works great in portrait mode. In landscape mode the right hand pane of the UISplitViewController completely disappears.

Was it helpful?

Solution

You can only present these from the primary view of your application. In this case, presenting from the UISplitViewController works.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top