0

this is my problem. I have MainViewController and a MenuViewController. When I go to the MenuViewController I can choose between several actions. One of them is Email Composer. When I click on that button, the MenyViewController goes away, the MainViewController is presented and then I wait for the Email View Controller, but it doesnt show. I get this error

Warning: Attempt to present <MFMailComposeViewController: 0x15f0ef000> on <app.MainViewController: 0x15e6d9090> while a presentation is in progress!

I understand why, but I cannot fix it. I tried with postponing the presentation of the Email Compose View Controller with a NSTimer, and it works.

Elida
  • 117
  • 9
  • Possible duplicate of [Meaning of Warning "while a presentation is in progress!"](http://stackoverflow.com/questions/14453001/meaning-of-warning-while-a-presentation-is-in-progress) – JAL Mar 07 '16 at 15:13

1 Answers1

0

Ran into a similar issue, comment of duplicate didn't help because I didn't have access to prior view controller, thought this might help someone else.

(My solution in Objective-C)

dispatch_async(dispatch_get_main_queue(), ^ {
    //present view controller
});
Tom
  • 1,330
  • 11
  • 21