Ios 自定义序列-从SuperView移除时防止闪烁

Ios 自定义序列-从SuperView移除时防止闪烁,ios,swift,Ios,Swift,我正在使用以下代码执行自定义序列: class PopFromMiddleSegue: UIStoryboardSegue { override func perform() { let sourceVC = self.sourceViewController let destinationVC = self.destinationViewController sourceVC.view.addSubview(destinationVC.view) destin

我正在使用以下代码执行自定义序列:

class PopFromMiddleSegue: UIStoryboardSegue {
override func perform()
{
    let sourceVC = self.sourceViewController
    let destinationVC = self.destinationViewController

    sourceVC.view.addSubview(destinationVC.view)
    destinationVC.view.transform = CGAffineTransformMakeScale(0.05, 0.05)
    UIView.animateWithDuration(0.5, delay: 0.0, options: .CurveEaseInOut, animations: { () -> Void in

        destinationVC.view.transform = CGAffineTransformMakeScale(1.0, 1.0)
        }) { (finished) -> Void in

            destinationVC.view.removeFromSuperview()
            let time = dispatch_time(DISPATCH_TIME_NOW, Int64(0.001 * Double(NSEC_PER_SEC)))
            dispatch_after(time, dispatch_get_main_queue()) {
                sourceVC.presentViewController(destinationVC, animated: false, completion: nil)

            }
    }
}
}

动画结束时,
destinationVC
闪烁一秒钟。您很快就会看到
sourceVC
,然后动画就完成了

如果我放入
//destinationVC.view.removeFromSuperview()

但下一次我回到segue的视图时,我的应用程序崩溃了

我怎样才能消除闪烁?非常感谢您的帮助