I have a strange problem when I just make a simple presentation modular controller. MFMailComposeViewController more precisely. However, it appears behind the view controller and thus you cannot send any emails or types. You can see the Cancel button on the UINavigationBar on the mail composer, but it appears behind the UIAlertController behind the view controller. How did this happen? Is this an iOS 11 issue? I also get similar behavior for UIAlertController too.
Also, if I click the Submit button and click my button to open another Composer, it works fine. This is only the first.
See the attached image I received from Xcode.

MFMailComposeViewController *mailer = [[MFMailComposeViewController alloc] init]; mailer.mailComposeDelegate = self; mailer.modalPresentationStyle = UIModalPresentationFormSheet; [mailer setSubject:@"subject Feedback"]; [mailer setToRecipients:@[@"email address"]]; [mailer setMessageBody:@"" isHTML:NO]; [self presentViewController:mailer animated:YES completion:nil];
Edit: Add a controller for more information.
#import "AboutViewController.h" #import <MessageUI/MessageUI.h> @interface AboutViewController () <MFMailComposeViewControllerDelegate> @property (nonatomic, strong) IBOutlet UIView *contentView; @end @implementation AboutViewController - (void)viewDidLoad { [super viewDidLoad]; self.title = @"About this app"; _contentView.layer.cornerRadius = 10.; _contentView.layer.shadowColor = [UIColor blackColor].CGColor; _contentView.layer.shadowRadius = 3.; _contentView.layer.shadowOpacity = 0.4; _contentView.layer.shadowOffset = CGSizeMake(3., 3.); // Do any additional setup after loading the view from its nib. } - (void)didReceiveMemoryWarning { [super didReceiveMemoryWarning]; // Dispose of any resources that can be recreated. } - (IBAction)sendFeedbackEmail:(id)sender { if ([MFMailComposeViewController canSendMail]){ dispatch_async(dispatch_get_main_queue(), ^{ MFMailComposeViewController *mailer = [[MFMailComposeViewController alloc] init]; mailer.mailComposeDelegate = self; mailer.modalPresentationStyle = UIModalPresentationFormSheet; [mailer setSubject:@"Feedback"]; [mailer setToRecipients:@[@" email@email.com "]]; [mailer setMessageBody:@"" isHTML:NO]; [self presentViewController:mailer animated:YES completion:nil]; }); } else { NSLog(@"Nope"); } } - (void)mailComposeController:(MFMailComposeViewController*)controller didFinishWithResult:(MFMailComposeResult)result error:(NSError*)error { [controller dismissViewControllerAnimated:YES completion:nil]; }
Edit 2:
I believe that I have found the answer. Hope this helps anyone who comes across the same issue. Thanks for all the answers, this helped me find the answer. Thanks to @Mert Buran for the delegate idea. This showed me that the first time he had another delegate to the transition, and the second the second time.
The problem was that the navigation controller moved the new controller before rejecting the controller that I had on top (menu controller). A simple fix, but since this is not obvious at the beginning and without error logs, it was difficult to point.
source share