Title: How to segue to one view controller from multiple navigation controllers and when done go back to whichever view controller presented it swift
Tags: ios;swift;uiviewcontroller;uistoryboardsegue
Question: So I have two navigation controller hierarchies that both lead to one view controller. I pass that one view controller data based on which one presented it with a push segue. How do I dismiss the final view controller and go back to the navigation stack that presented it? I don't need to pass any info back, but when I tried to do an unwind segue I was getting an error stating "this class is not key value coding-compliant for the key doneButtonTapped" I tried unWind segue and popVC segue.
I believe the problem might be that you can't have two separated navigation stacks leading to one view controller because that view controller doesn't know which stack it is a part of. I tried researching but could only find how to dismiss multiple modal views at once, nothing about dismissing one VC to which ever VC presented it at the time.
Thanks

Here is the accepted answer: You just need to call popViewController to dissmiss viewcontroller. It will automatically follow navigation stack which was created by navigationcontroller A or B.
If you want to pop to first viewcontroler then can call popToRootViewController.
Hope this will help :)
Comment for this answer: It actually turns out I had doneButtonTapped Action set up twice on the same VC. Woops. Its 5am and when I start doing things like that its time to call it a night. Your answer did help confirm what I am trying to do is possible. Thanks!

Here is another answer: Just set storyboard ID's for the navigation controllers,  Once you reach the final view controller. Just use:
self.performSegueWithIdentifier(identifier: String, sender: AnyObject?)
use prepareForSegue to get to NavigationViewController you want
Set a Bool value and pass it along from Navigation view controllers, while traversing to the last view controller. For example, pass true when going from Nav A, and pass false when going from Nav B. Once you get to the final ViewController, use this boolean value :
if boolValue == true {
self.performSegueWithIdentifier(identifier: "identifierforNavA", sender: AnyObject?)
else {
self.performSegueWithIdentifier(identifier: "identifierforNavB", sender: AnyObject?)
Don't forget to implement prepareForSegue for performSegueWihIdentifier to work

{'source': 'StackExchangeDataset', 'subset': 'stackoverflow.com', 'metadata': {'AnswerCount': 2, 'CommentCount': 0, 'ContentLicense': 'CC BY-SA 3.0', 'CreationDate': '2016:00:05/26/16', 'FavoriteCount': None, 'PostTypeId': 1, 'Tags': '<ios><swift><uiviewcontroller><uistoryboardsegue>', 'Title': 'How to segue to one view controller from multiple navigation controllers and when done go back to whichever view controller presented it swift', 'ViewCount': 1468, 'id': 37455069, 'user_AboutMe': None, 'user_AccountId': 8355340.0, 'user_DisplayName': 'JustinM', 'user_Reputation': 2162.0, 'user_Views': 105.0, 'user_id': 6275848.0}}