title: How to change color of view fade in CATransition
body: <p>I'm implementing a custom CATransition so I can presentViewController from the left or right instead of the bottom, but am encountering an interesting issue with what the CATransition does. </p>
  
  <p>Here is my code:</p>
  
  <pre><code>let transition:CATransition = CATransition()
  transition.duration = 2
  
  transition.timingFunction = CAMediaTimingFunction(name: kCAMediaTimingFunctionDefault)
  transition.type = kCATransitionMoveIn
  transition.subtype = kCATransitionFromLeft
  self.view.window?.layer.addAnimation(transition, forKey: nil)
  </code></pre>
  
  <p>Everything works as expected with the view that is being presented, but what happens to the view that is being replaced is what is interesting. It slowly fades to black, which creates a nasty black flash before my new view is fully animated in.</p>
  
  <p>As seen in the image below, the closer my new view comes to being fully animated in, the darker the old view becomes. It reaches full black right before the view is fully transitioned in.</p>
  
  <p><a href="https://i.stack.imgur.com/vy9ox.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/vy9ox.png" alt="enter image description here"></a></p>