  override func animationDidStop(anim: CAAnimation, finished flag: Bool) {     if let transitionContext = self.transitionContext {         transitionContext.completeTransition(!transitionContext.transitionWasCancelled())     