Skip to content

Instantly share code, notes, and snippets.

@fuxingloh
Last active March 29, 2019 04:51
Show Gist options
  • Select an option

  • Save fuxingloh/93f9d072d10da1738828 to your computer and use it in GitHub Desktop.

Select an option

Save fuxingloh/93f9d072d10da1738828 to your computer and use it in GitHub Desktop.
iOS Swift: A PushDissolveAnimationSegue with a dissolve animation,
class PushDissolveAnimationSegue: UIStoryboardSegue {
override func perform() {
let transition = CATransition()
transition.duration = 0.2
transition.type = kCATransitionFade
self.sourceViewController.navigationController!.view.layer.addAnimation(transition, forKey: kCATransition)
self.sourceViewController.navigationController!.pushViewController(self.destinationViewController, animated: false)
// No animation below
// if let navigation = sourceViewController.navigationController {
// navigation.pushViewController(destinationViewController, animated: false)
// }
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment