When a button is clicked, the end user is able to send an email. However the nav bar won’t go away, and the email nav bar is hidden underneath the main one. Is there a way to hide the main one? This is the action that is called when the button is pressed:
-(void)goToEmail{
if([MFMailComposeViewController canSendMail]) {
MFMailComposeViewController *mailCont = [[MFMailComposeViewController alloc] init];
mailCont.mailComposeDelegate = self;
[mailCont setSubject:@"Hello!"];
[mailCont setToRecipients:[NSArray arrayWithObject:@"name@email.com"]];
[mailCont setMessageBody:@"Test" isHTML:NO];
[self.navigationController setNavigationBarHidden:YES];
[self presentModalViewController:mailCont animated:YES];
}
}
self.navigationController.navigationBaris the mail controller’s navigation controller. Therefore, you’re hiding the email navigation bar, not the main one. You shouldn’t have to hide the main one at all. Take that call ([self.navigationController setNavigationBarHidden:YES];) out and see what you get. You should see the mail controller in front of the other, showing a nav bar. The main nav bar will still be visible, but it will be behind.