Skip to content

Instantly share code, notes, and snippets.

@gbertb
Created October 26, 2018 20:41
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save gbertb/56115e90ad40eeb2847c5be34bb81bc6 to your computer and use it in GitHub Desktop.
Save gbertb/56115e90ad40eeb2847c5be34bb81bc6 to your computer and use it in GitHub Desktop.
custom fade view transition
// RoommateMatchQuestionViewController.swift
let vc = RoommateMatchQuestionViewController.newInstance()
vc.viewModel = self.viewModel.viewModelForNextQuestion()
let transition = CATransition()
transition.duration = 0.5
transition.timingFunction = CAMediaTimingFunction(name: kCAMediaTimingFunctionEaseInEaseOut)
transition.type = kCATransitionFade
transition.subtype = kCATransitionFromLeft
self.navigationController?.view.layer.add(transition, forKey: nil)
self.navigationController?.pushViewController(vc, animated: true)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment