2
votes

I am now using the tabbar controller and the uinavigation controller, when I call the MFMailComposeViewController by presentviewcontroller, and dismissed by dismissviewcontrolleranimated, I swipe back and click to push the viewcontroller again I found the back button is disappear and the title is wrong.

Tab-> ViewController [A] (Navigation Controller Embed) -(PUSH)-> ViewController[B] (with back button) -(Present)-> MFMailComposeViewController -(Dismiss)-> Show ViewController[B] -(Swipe Back)-> ViewController [A] -(Push) -> ViewController[B] (back button is disappear and the title is wrong)

Even I press back instead of swipe back, I found that there is still some problem not behave as usual navigation push controller

Many thanks if anyone could help!


After all these, ViewController[B] pop/swipe back to ViewController[A] viewdidappear and viewwillappear function in ViewController[A] are not triggered.

1
In order to get better answers you should include as actual code. Ideally as much relevant code as possible but at a minimum the code directly related to the issue. - Flatlyn
i faced this issue with swipe back, try to set navigation title, etc. in viewWillAppear and hide the title in viewWillDisAppear method. I hope this will helps. - RJV Kumar

1 Answers

1
votes

I have the exact same flow in my app, but I don't have any problem with the nav bar getting messed up.

Here's how the view controller is created:

MFMailComposeViewController *mailVC = [[MFMailComposeViewController alloc] init];

The delegate is set:

mailVC.mailComposeDelegate = self;

The view controller is presented:

[self presentViewController:mailVC animated:YES completion:nil];

The view controller is dismissed in the delegate method which is called when the user presses the Cancel button in the nav bar:

- (void)mailComposeController:(MFMailComposeViewController*)controller didFinishWithResult:(MFMailComposeResult)result error:(NSError*)error 
{
    [self dismissViewControllerAnimated:YES completion:nil];
}   

Hope this helps.