Swift custom segue doesn't work on consecutive segues
<p>I made a custom segue that moves the current view to the left and moves the next view in from the right at the same time. When I used it on the first  segueway it works perfectly, but when used in the next segueway only the destination view moves. The code for the segue looks like the following:</p>

<pre><code>class CustomSlideSegue: UIStoryboardSegue {

    override func perform() {
        let firstVCView = self.sourceViewController.view as UIView!
        let secondVCView = self.destinationViewController.view as UIView!

        let screenWidth = UIScreen.mainScreen().bounds.size.width
        let screenHeight = UIScreen.mainScreen().bounds.size.height

        secondVCView.frame = CGRectMake(screenWidth, 0, screenWidth, screenHeight)

        let window = UIApplication.sharedApplication().keyWindow
        window?.insertSubview(secondVCView, aboveSubview: firstVCView)

        UIView.animateWithDuration(0.6, animations: { () -&gt; Void in
             firstVCView.transform = CGAffineTransformMakeTranslation(-screenWidth, 0)
             secondVCView.transform = CGAffineTransformMakeTranslation(-screenWidth, 0)
    }) { (Finished) -&gt; Void in
            self.sourceViewController.presentViewController(self.destinationViewController as UIViewController, animated: false, completion: nil)
        }
    }
}
</code></pre>

<p>And here is the code from the view controller button action method where I start the segue:</p>

<pre><code>performSegueWithIdentifier("customSlideSegue", sender: self)
</code></pre>

<p>Here is a video showing the segues:</p>

<p><a href="https://i.stack.imgur.com/FAmnm.gif" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/FAmnm.gif" alt="The second slide happens after the image picker."></a></p>

<p>Can anyone see the problem? Or how should I go about debugging this? Thankful for replies!</p>