1

Extremely strange problem here: When unwinding from VC3 to VC1, VC3 animates down and behind it is VC3! Then that goes away and I'm back to VC1. It all happens in about 1 second, but it's clearly a duplicate. Anyone know why?

I'd be less surprised if VC2 was behind it, because I transited it to get to VC3 but literally an exact duplicate of VC3 is behind it when it animates down. Any insight would be appreciated.

Code triggered from VC2 to introduce VC3 (no nav. controller in this app):

self.performSegue(withIdentifier: "segueToVC3", sender: self)

Connections inspector of VC3 button that triggers unwind:

enter image description here

Code triggered by VC3 button:

@IBAction func next_toNextQuestion (_ sender: AnyObject) {
        self.performSegue(withIdentifier: "unwind_ToNext", sender: self)
}

Then this unwind code in VC1 gets called after a half second delay, which calls a new VC:

@IBAction func unwind_ToNext (_ segue: UIStoryboardSegue) {
    callDelayedSegue(delayDuration: 0.5)
}
Dave G
  • 12,042
  • 7
  • 57
  • 83
  • 1
    You need to provide much info about what you're doing. At least show a screen shot of this part of the storyboard (or the code that performs these transitions to start with). – matt Nov 04 '16 at 01:34
  • Add some code and screenshot? – Yuchen Nov 04 '16 at 01:36
  • Did you wire the segue from a button and then also call it programmatically with `performSegue(with: indentifier)`? You would be creating 2 copies of your VC3 in that case. – vacawama Nov 04 '16 at 02:46
  • @vacawama Great thought, but I just checked and I have no connection from the button except Touch-Up-Inside – Dave G Nov 04 '16 at 12:44
  • Sorry, but that isn't what I meant. I meant, how do these view controllers get into place to begin with? vacawama's suggestion still seems extremely likely. Disprove it. – matt Nov 04 '16 at 14:56
  • @matt I agree it sounds likely but I included a screenshot of the button connections and the code, if there's a way to further disprove it, I'm not aware of it. I just added the code you asked for. – Dave G Nov 04 '16 at 15:29
  • No, you showed how the _unwind_ is triggered. I am asking you how these view controllers got put into place _originally_. I want to know the architecture of what you are unwinding _from_. – matt Nov 04 '16 at 15:45
  • Did you figure this one out? – yesthisisjoe Nov 07 '16 at 17:27
  • @yesthisisjoe Not yet- got an idea? – Dave G Nov 08 '16 at 01:29
  • I think the problem was something completely different. My unwind segue actually had code that was pushing the view I was unwinding from (VC3 in your case). Somehow the order still went VC3 -> VC3 -> VC1. So maybe check the code in your segue to make sure it isn't presenting VC3 again. – yesthisisjoe Nov 08 '16 at 06:11

0 Answers0