Reputation: 9351
I am using a standalone UINavigationBar with one button that toggles a side menu on the left. It works flawlessly.
Now I wanted to add a email feedback form using MFMailComposeViewController. It shows up and I can edit all the fields (To, Subject, Body) but when I want to "send" the button doesn't react. When I go to click "Cancel" I notice that the functionality of the underlying UINavigationBar button triggers. It seems as if my UINavigationBar is "above" the NavigationBar of the email compose dialog even though I only see the email compose dialog.
Is there any way to ensure that the MFMailComposeViewController is on top of everything else?
Thanks
Upvotes: 1
Views: 498
Reputation: 12421
I see you're setting the delegate to self
, which is good, but are you also implementing the following method?
- (void)mailComposeController:(MFMailComposeViewController *)controller didFinishWithResult:(MFMailComposeResult)result error:(NSError *)error
{
[self dismissViewControllerAnimated:YES completion:nil];
}
I would guess that cancelling is somehow handled without dismissing the composing view controller?
I would also try modifying the following line:
[self presentModalViewController:controller animated:YES];
to this:
[self.navigationController presentModalViewController:controller animated:YES];
If you're using a navigation bar, as you said, then try presenting from your view controller's nab controller instead.
This could be something weird like a strange interaction with wantsFullscreenLayout
of your view controller. Double check all your nib connections, and if it's still not working, try pushing another, "test" view controller. It could be something with your code or nib and not the MFMailComposeViewController
itself.
Upvotes: 2