Denis
Denis

Reputation: 13

Unwanted View Dismissal After Segue

I'm trying to perform dismissal of modal ViewController and after that automatically move to the next ViewController. I use for this unwind segue and performSegue inside unwind.

@IBAction func unwindWithChatTo(unwindSegue: UIStoryboardSegue) {
    performSegue(withIdentifier: "chatStartTwo", sender: nil)
}

The problem: is that after performSegue executed and the next ViewController appears, unwanted segue back to the first view is performed.

The flow: Modаl View -> 1VC -> 2VC -> 1VC (Unwanted)

What could be the reason of this unwanted segue back and how to fix this?

I haven't found any advice on such cases. Much appreciate you advice.

Upvotes: 0

Views: 40

Answers (1)

Manish Punia
Manish Punia

Reputation: 877

Check if 2VC has any segue defined(performed) in the storyboard or programmatically. Try putting a breakpoint in viewDidLoad or viewWillApear of 1VC or viewWillDisAppear of 2VC and try to trace back the trigger point for displaying 1VC again.

Upvotes: 0

Related Questions