I am facing strange issue regarding Present and Dismiss ViewController.
For e.g :-
I am at ViewController A then i push to B
So in Navigation Controller Stack we have [A,B]
Now if i present any view controller on B (Like MFMailComposeViewController)
Then after sending mail or deleting draft it dismiss the MFMailComposeViewController and it redirects to A instead of B.
I have researched regarding this but can't find any alternative.
Hello you can do it like this, when you dismiss after sending mail or deleting draft it dismiss the MFMailComposeViewController and after that you can check the ViewController_Identifier if it is 'A_Screen' then avoid it or escape it. Else if, it is 'B-Screen' then navigate to that view controller.
Use this logic to navigate as you want.
Make sure, that you have set identifierID for your ViewControllers.
Hope it helps you.
if you have called Popviewcontroller method in didFinishWithResult method of MFMailComposeViewControllerDelegate in ViewControllerB, then it could be possible. instead you avoid PopViewController method call in didFinishWithResult method call.
Hope this helps. Use it when you switch between A -> B.
```let storyboard = UIStoryboard(name: "Main", bundle: nil)
desiredViewController = storyboard.instantiateViewController(withIdentifier: "desiredViewController")
UIApplication.shared.delegate?.window??.rootViewController? = desiredViewController ```
try this to presented MFMailComposeViewController from B
You might have used
Hope this helps