Please note that this is a corrected answer - in response to the first comment below.
I have a possible solution that seems to work. But this may not be acceptable. I am not sure and offer it only for consideration.
The 3 view managers are configured as described in the question (the second is red so I can see if this is visible during unwinding).

U-roll is created in the third view controller (C) by dragging and dropping in Exit. Before this, the necessary actions must be added to the first and second view controllers.


Below is the code for 3 controllers. My fix - I use the global logical name unwindCheck as a flag that sets true before disconnecting, but false otherwise. If this is true , then self.view.hidden = true in viewWillAppear for the second view controller. those. hidden during unwinding.
Note that I also added a second button on the third view controller - it calls the same segue spread - whose identifier property is set to "UnwindToFirstSegue" . The second button is not a necessary part of this possible solution.
class FirstViewController: UIViewController { @IBAction func unwindToFirstViewController(segue: UIStoryboardSegue) { } override func viewDidLayoutSubviews() { unwindCheck = false } } class SecondViewController: UIViewController { override func viewWillAppear(animated: Bool) { super.viewWillAppear(animated) if unwindCheck == true { self.view.hidden = true } } @IBAction func unwindToSecondViewController(segue: UIStoryboardSegue) { } } class ThirdViewController: UIViewController { @IBAction func backToA(sender: AnyObject) { performSegueWithIdentifier("UnwindToFirstSegue", sender: self) } override func prepareForSegue(segue: UIStoryboardSegue, sender: AnyObject?) { if let identifier = segue.identifier{ switch identifier { case "UnwindToFirstSegue": unwindCheck = true default: break } } } }
The unwind identifier can be set by selecting it in the document structure, and then go to the attribute inspector.
source share