Да. Все три возможны, однако # 2 потребует использования частного API или какой-либо хакерской атаки.Я использовал подход подкласса MFMailComposeViewController, как показано ниже:
// file: CustomMailComposeViewController.h
@interface CustomMailComposeViewController : MFMailComposeViewController {
}
@end
// file ustomMailComposeViewController.m
#import "CustomMailComposeViewController.h"
@implementation CustomMailComposeViewController
-(void)viewWillAppear:(BOOL)animated {
[super viewWillAppear:animated];
//Here we replace the cancel button with a back button (Question #3)
UIBarButtonItem *backButton = [[UIBarButtonItem alloc] initWithTitle:@"Back" style:UIBarButtonItemStylePlain target:self action:@selector(backButtonPressed:)];
self.navigationBar.topItem.leftBarButtonItem = backButton;
[backButton release];
//Here we disallow the user to change to to: cc: bcc: and subject: feilds (Question #2)
//Warning: the xxxField methods are undocumented private methods.
UITableViewController *vc = [self.viewControllers objectAtIndex:0];
UITableView *tvv = [vc view];
[[tvv toField] setUserInteractionEnabled:NO];
[[tvv ccField] setUserInteractionEnabled:NO];
[[tvv bccField] setUserInteractionEnabled:NO];
[[tvv multiField] setUserInteractionEnabled:NO];
[[tvv subjectField] setUserInteractionEnabled:NO];
}
//This is the target for the back button, to immeditally dismiss the VC without an action sheet (#1)
-(void) backButtonPressed:(id)sender {
[self dismissModalViewControllerAnimated:YES];
}
@end
Для использования в вашем коде вы должны изменить: [[MFMailComposeViewController alloc] init];[[CustomMailComposeViewController alloc] init];