Swift CATransition: Is there anyway to remove the fading effect from this animation?

2.8k views Asked by At

I have an animation here but when the old ViewController is pushed out of the window it fades to black and the new one fades in from black which doesn't look very nice. Is there a way the remove this fading effect?

    let transition = CATransition()
    transition.duration = 3
    transition.type = kCATransitionPush
    transition.subtype = kCATransitionFromRight

    self.window?.layer.add(transition, forKey: kCATransition)
    self.window?.rootViewController?.present(profilePreview, 
    animated: 
    false, completion: nil)

I'm pretty new to programming in general so any help would be appreciated.

1

There are 1 answers

0
Matt On BEST ANSWER

Answering my own question, the only solution I can find is this: Custom segue transition animation

Credit to Hussain Shabbir